-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from JeffersonLab/build
Build "system" cleanup
- Loading branch information
Showing
18 changed files
with
169 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,7 @@ errors.txt | |
.lesshst | ||
RNDMSTATUS | ||
LHAPDF* | ||
genie | ||
log4cpp* | ||
pythia6* | ||
root* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,140 @@ | ||
|
||
TOP = $(shell pwd) | ||
|
||
SUBDIRS = clasdis claspyth dvcsgen inclusive-dis-rad TCSGen genKYandOnePion JPsiGen twopeg MCEGENpiN_radcorr deep-pipi-gen genepi gibuu onepigen genie | ||
|
||
build: gibuu | ||
mkdir -p bin lib | ||
$(MAKE) -C clasdis | ||
$(MAKE) -C claspyth | ||
$(MAKE) -C dvcsgen | ||
$(MAKE) -C genKYandOnePion | ||
$(MAKE) -C inclusive-dis-rad | ||
$(MAKE) -C JPsiGen | ||
$(MAKE) -C TCSGen | ||
$(MAKE) -C MCEGENpiN_radcorr | ||
$(MAKE) -C deep-pipi-gen | ||
$(MAKE) -C genepi | ||
$(MAKE) -C onepigen | ||
$(MAKE) -C genie | ||
# twopeg needs c++17 support: | ||
MAKEDIRS := $(shell find . -maxdepth 2 -mindepth 2 -name Makefile | awk -F/ '{print$$2}') | ||
SUBMODULES := $(shell grep ^\\[submodule .gitmodules | awk -F\" '{print$$2}') | ||
CLEANDIRS := $(MAKEDIRS) | ||
MAKEDIRS := $(filter-out gibuu,$(MAKEDIRS)) | ||
MAKEDIRS := $(filter-out genie,$(MAKEDIRS)) | ||
MAKEDIRS := $(filter-out twopeg,$(MAKEDIRS)) | ||
|
||
TOP := $(shell pwd) | ||
|
||
export GENIE := $(TOP)/genie | ||
|
||
all: gibuu genie twopeg elspectro $(MAKEDIRS) | ||
|
||
$(MAKEDIRS): | ||
$(MAKE) -C $@ | ||
.PHONY: $(MAKEDIRS) | ||
|
||
elspectro: | ||
rm -rf build && mkdir build | ||
+ cd build && cmake -DCMAKE_CXX_COMPILER=`which g++` -DCMAKE_C_COMPILER=`which gcc` ../ | ||
+ cd build && cmake --build . --target install | ||
.PHONY: elspectro | ||
|
||
twopeg: | ||
sed -i 's/\(^CXX .*= g++ \)/\1 -std=c++17 /' twopeg/Makefile | ||
# seems twopeg has a non-standard(?) Makefile and requires this instead: | ||
cd twopeg ; $(MAKE) nobos ; cd -- | ||
# clas12-elSpectro uses cmake: | ||
+ mkdir build && cd build && cmake -DCMAKE_CXX_COMPILER=`which g++` -DCMAKE_C_COMPILER=`which gcc` ../ && cmake --build . --target install && cd .. | ||
install clas12-elSpectro/elSpectro/jpacPhoto/lib/* lib | ||
install clasdis/clasdis bin | ||
install claspyth/claspyth bin | ||
install dvcsgen/dvcsgen bin | ||
install genKYandOnePion/genKYandOnePion bin | ||
install inclusive-dis-rad/inclusive-dis-rad bin | ||
install JPsiGen/JPsiGen.exe bin | ||
install JPsiGen/JPsiGen bin | ||
install twopeg/twopeg bin | ||
install JPsiGen/lib/libJPsiGen.so lib | ||
install TCSGen/TCSGen.exe bin | ||
install TCSGen/TCSGen bin | ||
install TCSGen/lib/libTCSGen.so lib | ||
install MCEGENpiN_radcorr/MCEGENpiN_radcorr bin | ||
install deep-pipi-gen/deep-pipi-gen bin | ||
install genepi/genepi bin | ||
install generate-seeds.py bin | ||
install onepigen/onepigen bin | ||
install onepigen/onepigen_lund bin | ||
rm -rf build | ||
|
||
clean: prune | ||
rm -rf bin lib lib64 build share include etc | ||
for dir in $(SUBDIRS); do\ | ||
$(MAKE) -C $$dir clean; \ | ||
done | ||
cd twopeg && $(MAKE) nobos | ||
.PHONY: twopeg | ||
|
||
prune: | ||
rm -rf LHAPDF* log4cpp* pythia6* | ||
gibuu: bin/GiBUU.x | ||
lhapdf: lib/libLHAPDF.so | ||
log4cpp: lib/liblog4cpp.so | ||
pythia6: lib/libPythia6.so | ||
|
||
gibuu: lhapdf | ||
$(MAKE) -C gibuu | ||
install -D gibuu/gibuu bin | ||
install -D gibuu/release/objects/GiBUU.x bin | ||
install -D gibuu/gibuu2lund bin | ||
bin/GiBUU.x: lhapdf | ||
$(MAKE) -C gibuu install | ||
|
||
lhapdf: | ||
lib/libLHAPDF.so: | ||
$(eval V := 6.5.4) | ||
wget https://lhapdf.hepforge.org/downloads/?f=LHAPDF-${V}.tar.gz -O LHAPDF-${V}.tar.gz | ||
tar -xzvf LHAPDF-${V}.tar.gz | ||
cd LHAPDF-${V} && ./configure --prefix=${TOP} | ||
cd LHAPDF-${V} && ./configure --prefix=${TOP} --disable-python | ||
$(MAKE) -C LHAPDF-${V} | ||
$(MAKE) -C LHAPDF-${V} install | ||
rm -rf LHAPDF* | ||
|
||
log4cpp: | ||
lib/liblog4cpp.so: | ||
wget https://sourceforge.net/projects/log4cpp/files/log4cpp-1.1.x%20%28new%29/log4cpp-1.1/log4cpp-1.1.4.tar.gz | ||
tar -xzvf log4cpp-1.1.4.tar.gz | ||
cd log4cpp && ./configure --prefix=${TOP} | ||
$(MAKE) -C log4cpp | ||
$(MAKE) -C log4cpp install | ||
rm -rf log4cpp* | ||
|
||
pythia6: | ||
lib/libPythia6.so: | ||
wget https://root.cern/download/pythia6.tar.gz | ||
tar -xzvf pythia6.tar.gz | ||
sed -i 's/^char /extern char /' ./pythia6/pythia6_common_address.c | ||
sed -i 's/^int /extern int /' ./pythia6/pythia6_common_address.c | ||
sed -i 's/^extern int pyuppr/int pyuppr /' ./pythia6/pythia6_common_address.c | ||
cd pythia6 && ./makePythia6.linuxx8664 | ||
install -D pythia6/libPythia6.so lib | ||
install -D pythia6/libPythia6.so lib/libPythia6.so | ||
|
||
lib/libgsl.so: | ||
wget https://ftp.gnu.org/gnu/gsl/gsl-2.7.tar.gz | ||
tar -xzvf gsl-2.7.tar.gz | ||
cd gsl-2.7 && ./configure --prefix=${TOP} | ||
$(MAKE) -C gsl-2.7 | ||
$(MAKE) -C gsl-2.7 install | ||
|
||
lib/libxml2.so: | ||
wget http://mirror.umd.edu/gnome/sources/libxml2/2.11/libxml2-2.11.0.tar.xz | ||
tar -xJvf libxml2-2.11.0.tar.xz | ||
cd libxml2-2.11.0 && ./configure --prefix=${TOP} --without-python | ||
$(MAKE) -C libxml2-2.11.0 | ||
$(MAKE) -C libxml2-2.11.0 install | ||
|
||
root: pythia6 | ||
$(eval V := 6.30.04) | ||
wget https://root.cern/download/root_v${V}.source.tar.gz | ||
tar xzf root_v${V}.source.tar.gz | ||
+ cmake -S root-${V} -B root-${V}-build \ | ||
-DCMAKE_CXX_STANDARD=17 \ | ||
-DCMAKE_INSTALL_PREFIX=${TOP}/root \ | ||
-Dbuiltin_glew=ON \ | ||
-Dmathmore=ON \ | ||
-Dfftw3=ON \ | ||
-Dpythia6=ON \ | ||
-DPYTHIA6_LIBRARY=${TOP}/lib/libPythia6.so | ||
+ cmake --build root-${V}-build --target install | ||
|
||
genie: pythia6 lhapdf log4cpp | ||
git clone -b R-3_04_00 --depth 1 https://github.com/GENIE-MC/Generator.git genie | ||
cd genie && ./configure \ | ||
--prefix=${TOP} --disable-profiler --disable-validation-tools \ | ||
--disable-doxygen --disable-cernlib --disable-lhapdf5 --enable-lhapdf6 \ | ||
--enable-flux-drivers --enable-geom-drivers --enable-dylibversion --enable-nucleon-decay \ | ||
--enable-test --enable-mueloss --enable-t2k --enable-fnal --enable-atmo \ | ||
--disable-masterclass --disable-debug --with-optimiz-level=O2 \ | ||
--with-pythia6-lib=${TOP}/lib --with-lhapdf6-inc=${TOP}/include --with-lhapdf6-lib=${TOP}/lib \ | ||
--with-log4cpp-inc=${TOP}/include --with-log4cpp-lib=${TOP}/lib | ||
$(MAKE) -C genie | ||
$(MAKE) -C genie install | ||
mv -f bin/genie bin/genie.exe | ||
$(MAKE) -C genie-util install | ||
|
||
install: | ||
install -D clasdis/clasdis bin/clasdis | ||
install -D claspyth/claspyth bin/claspyth | ||
install -D dvcsgen/dvcsgen bin/dvcsgen | ||
install -D genKYandOnePion/genKYandOnePion bin/genKYandOnePion | ||
install -D inclusive-dis-rad/inclusive-dis-rad bin/inclusive-dis-rad | ||
install -D JPsiGen/JPsiGen.exe bin/JPsiGen.exe | ||
install -D JPsiGen/JPsiGen bin/JPsiGen | ||
install -D twopeg/twopeg bin/twopeg | ||
install -D JPsiGen/lib/libJPsiGen.so lib/libJPsiGen.so | ||
install -D TCSGen/TCSGen.exe bin/TCSGen.exe | ||
install -D TCSGen/TCSGen bin/TCSGen | ||
install -D TCSGen/lib/libTCSGen.so lib/libTCSGen.so | ||
install -D MCEGENpiN_radcorr/MCEGENpiN_radcorr bin/MCEGENpiN_radcorr | ||
install -D deep-pipi-gen/deep-pipi-gen bin/deep-pipi-gen | ||
install -D genepi/genepi bin/genepi | ||
install -D generate-seeds.py bin/generate-seeds.py | ||
install -D onepigen/onepigen bin/onepigen | ||
install -D onepigen/onepigen_lund bin/onepigen_lund | ||
install -D clas12-elSpectro/elSpectro/jpacPhoto/lib/* lib | ||
|
||
clean: | ||
rm -rf bin lib lib64 build share include etc | ||
for dir in $(CLEANDIRS); do\ | ||
$(MAKE) -C $$dir clean; \ | ||
done | ||
rm -rf LHAPDF* log4cpp* pythia6* libxml* root-* build | ||
|
||
prune: | ||
rm -rf LHAPDF* log4cpp* pythia6* libxml* root-* build | ||
|
||
debug: | ||
@ echo SUBMODULES: $(SUBMODULES) | ||
@ echo CLEANDIRS: $(CLEANDIRS) | ||
@ echo MAKEDIRS: $(MAKEDIRS) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
genie2lund |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
ROOT_CFLAGS := $(shell root-config --cflags) | ||
ROOT_LIBS := $(shell root-config --libs) | ||
|
||
install: build | ||
install -D genie2lund ../bin | ||
install -D genie ../bin | ||
|
||
build: | ||
$(CXX) $(ROOT_CFLAGS) -o genie2lund genie2lund.cxx $(ROOT_LIBS) | ||
|
||
clean: | ||
rm -f genie2lund | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.