Hi everyone here is my quick story.
I am developing applications in Geant4 ( a particle physics program that is based in C++) for my PhD work. The program can be found at
http://geant4.cern.ch/.
Basically, you create an application by having this structure.
Root Folder (let's call it "Experiment1") - This folder contains the main.cc, a makefile "GNUMakeFile", and any other little macro files.
An example of the makefile is shown below.
--------------------------------
# $Id: GNUmakefile,v 1.1 1999/01/07 16:05:42 gunter Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
name := NRFCT_Rev0
G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../..
endif
.PHONY: all
all: lib bin
include $(G4INSTALL)/config/binmake.gmk
########################### ROOT #################################
ifdef ROOTSYS
ifndef G4UI_USE_ROOT
ROOTCPPFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags)
#ROOTCPPFLAGS := $(filter-out -D_REENTRANT,$(ROOTCPPFLAGS))
#ROOTCPPFLAGS := $(filter-out -pthread,$(ROOTCPPFLAGS))
CPPFLAGS += -DG4ANALYSIS_USE_ROOT $(ROOTCPPFLAGS)
ROOTLIBS = $(shell $(ROOTSYS)/bin/root-config --nonew --glibs)
ROOTLIBS := $(filter-out -lNew,$(ROOTLIBS))
#ROOTLIBS := $(filter-out -lThread,$(ROOTLIBS))
#ROOTLIBS := $(filter-out -lpthread,$(ROOTLIBS))
#ROOTLIBS := $(filter-out -pthread,$(ROOTLIBS))
ROOTLIBS += -lMinuit -lHtml
LDLIBS += $(ROOTLIBS)
endif
endif
-------------------------
Two folders inside the root folder are
src and
include these folders contain more .cc and .h files for the application that I write. They control things such as particle physics, geometry, etc in the program.
Here is my question for the Code::Blocks gurus. Basically, the way I have been running my application is after I create all the files and so on. I go to the "Experiment" folder and type in
make. I am using Ubuntu Hardy Heron with the latest stable gcc compiler. That make creates a file that I can then run barring no compilation errors.
I really would like to know how to set this type of environment up in Code::Blocks. I'm tired of doing all my c++ in Gedit/terminal, lol, and I would love to use this IDE.
So basically, how do I get code::blocks to understand Geant4 (similar to when I am typing make in terminal)? Here is the end of my .bashrc setup that includes a few really important compilation lines.
-------------------------
export ROOTSYS="/usr/local/root"
export G4WORKDIR=/home/nebulism/GEANT4/work/
export LD_LIBRARY_PATH="/usr/share/CLHEP/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$ROOTSYS/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$ROOTSYS/include:$LD_LIBRARY_PATH"
export PATH="/opt/ActiveTcl-8.5/bin:$PATH"
export PATH="/usr/share/Dawn/dawn_3_88a/:$PATH"
source /usr/share/GEANT4/geant4.9.1.p03/env.sh
---------------
Do I set this up somewhere in Code::Blocks, so that it may compile?
Thank you so much for your time,
John Perry