galacticusorg / galacticus

The Galacticus galaxy formation model
GNU General Public License v3.0
24 stars 16 forks source link

Issue When I run Make #198

Closed liempi closed 2 years ago

liempi commented 2 years ago

Hello, I'm trying to install Galacticus but when I type make in my shell I obtain:

File does not exist: ./work/build/stateStorables.xml at /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/XML/Simple.pm line 981. XML::Simple::find_xml_file(XML::Simple=HASH(0x7fb4cf8f4cd0), "./work/build/stateStorables.xml") called at /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/XML/Simple.pm line 238 XML::Simple::parse_file(XML::Simple=HASH(0x7fb4cf8f4cd0), "./work/build/stateStorables.xml") called at /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/XML/Simple.pm line 218 XML::Simple::XMLin(XML::Simple=HASH(0x7fb4cf8f4cd0), "./work/build/stateStorables.xml") called at /Users/liempi/Documents/galacticus/perl/Galacticus/Build/SourceTree/Process/ObjectBuilder.pm line 51 Galacticus::Build::SourceTree::Process::ObjectBuilder::Process_ObjectBuilder(HASH(0x7fb4c8c15e88), HASH(0x7fb4c89e5380)) called at /Users/liempi/Documents/galacticus/perl/Galacticus/Build/SourceTree.pm line 184 Galacticus::Build::SourceTree::ProcessTree(HASH(0x7fb4c8c15e88)) called at ./scripts/build/buildCode.pl line 217 at /Users/liempi/Documents/galacticus/perl/Galacticus/Build/Components.pm line 69. Galacticus::Build::Components::ANON("File does not exist: ./work/build/stateStorables.xml at /usr/"...) called at /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0/Carp.pm line 291 Carp::croak("File does not exist: ./work/build/stateStorables.xml") called at /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/XML/Simple.pm line 981 XML::Simple::find_xml_file(XML::Simple=HASH(0x7fb4cf8f4cd0), "./work/build/stateStorables.xml") called at /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/XML/Simple.pm line 238 XML::Simple::parse_file(XML::Simple=HASH(0x7fb4cf8f4cd0), "./work/build/stateStorables.xml") called at /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/XML/Simple.pm line 218 XML::Simple::XMLin(XML::Simple=HASH(0x7fb4cf8f4cd0), "./work/build/stateStorables.xml") called at /Users/liempi/Documents/galacticus/perl/Galacticus/Build/SourceTree/Process/ObjectBuilder.pm line 51 Galacticus::Build::SourceTree::Process::ObjectBuilder::Process_ObjectBuilder(HASH(0x7fb4c8c15e88), HASH(0x7fb4c89e5380)) called at /Users/liempi/Documents/galacticus/perl/Galacticus/Build/SourceTree.pm line 184 Galacticus::Build::SourceTree::ProcessTree(HASH(0x7fb4c8c15e88)) called at ./scripts/build/buildCode.pl line 217

abensonca commented 2 years ago

Can you try removing the build directory and then making again sending the output to a log file? Like this:

rm -rf work/build
make Galacticus.exe >& make.log

and then post the make.log here?

liempi commented 2 years ago

Here is the make.log file:

./scripts/build/findExecutables.pl pwd ./scripts/build/codeDirectivesParse.pl pwd ./scripts/build/stateStorables.pl pwd ./scripts/build/deepCopyActions.pl pwd ./scripts/build/includeDependencies.pl pwd g++ -c source/libmatheval_config.cpp -o ./work/build/libmatheval_config.o -DBUILDPATH=\'./work/build\' -I./source/ -I./work/build/ -fopenmp -g -DOFDLOCKS > /dev/null 2>&1 ; \ if [ $? -eq 0 ] ; then \ echo "FCFLAGS += -DMATHEVALAVAIL" > ./work/build/Makefile_Config_MathEval ; \ echo "CPPFLAGS += -DMATHEVALAVAIL" >> ./work/build/Makefile_Config_MathEval ; \ else \ echo "FCFLAGS += -DMATHEVALUNAVAIL" > ./work/build/Makefile_Config_MathEval ; \ echo "CPPFLAGS += -DMATHEVALUNAVAIL" >> ./work/build/Makefile_Config_MathEval ; \ fi g++ -c source/ann_config.cpp -o ./work/build/ann_config.o -DBUILDPATH=\'./work/build\' -I./source/ -I./work/build/ -fopenmp -g -DOFDLOCKS > /dev/null 2>&1 ; \ if [ $? -eq 0 ] ; then \ echo "FCFLAGS += -DANNAVAIL" > ./work/build/Makefile_Config_ANN ; \ echo "CPPFLAGS += -DANNAVAIL" >> ./work/build/Makefile_Config_ANN ; \ else \ echo "FCFLAGS += -DANNUNAVAIL" > ./work/build/Makefile_Config_ANN ; \ echo "CPPFLAGS += -DANNUNAVAIL" >> ./work/build/Makefile_Config_ANN ; \ fi gfortran -c source/fftw3_config.F90 -o ./work/build/fftw3_config.o -ffree-line-length-none -frecursive -DBUILDPATH=\'./work/build\' -J./work/build/moduleBuild/ -I./work/build/ -fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/lib/gfortran/modules -fintrinsic-modules-path /usr/include/gfortran -fintrinsic-modules-path /usr/include -fintrinsic-modules-path /usr/finclude -fintrinsic-modules-path /usr/lib64/gfortran/modules -fintrinsic-modules-path /usr/lib64/openmpi/lib -pthread -Wall -fbacktrace -ffpe-trap=invalid,zero,overflow -fdump-core -O3 -ffinite-math-only -fno-math-errno -fopenmp -g > /dev/null 2>&1 ; \ if [ $? -eq 0 ] ; then \ echo "FCFLAGS += -DFFTW3AVAIL" > ./work/build/Makefile_Config_FFTW3 ; \ else \ echo "FCFLAGS += -DFFTW3UNAVAIL" > ./work/build/Makefile_Config_FFTW3 ; \ fi gcc -c source/flock_config.c -o ./work/build/flock_config.o -DBUILDPATH=\'./work/build\' -I./source/ -I./work/build/ -fopenmp -g -DOFDLOCKS > /dev/null 2>&1 ; \ if [ $? -eq 0 ] ; then \ echo "FCFLAGS += -DOFDAVAIL" > ./work/build/Makefile_Config_OFD ; \ echo "CFLAGS += -DOFDAVAIL" >> ./work/build/Makefile_Config_OFD ; \ echo "CPPFLAGS += -DOFDAVAIL" >> ./work/build/Makefile_Config_OFD ; \ else \ echo "FCFLAGS += -DOFDUNAVAIL" > ./work/build/Makefile_Config_OFD ; \ echo "CFLAGS += -DOFDUNAVAIL" >> ./work/build/Makefile_Config_OFD ; \ echo "CPPFLAGS += -DOFDUNAVAIL" >> ./work/build/Makefile_Config_OFD ; \ fi gcc source/proc_config.c -o ./work/build/proc_config -DBUILDPATH=\'./work/build\' -I./source/ -I./work/build/ -fopenmp -g -DOFDLOCKS > /dev/null 2>&1 ; \ if [ $? -eq 0 ] ; then \ ./work/build/proc_config > /dev/null 2>&1 ; \ if [ $? -eq 0 ] ; then \ echo "FCFLAGS += -DPROCPS" > ./work/build/Makefile_Config_Proc ; \ echo "CFLAGS += -DPROCPS" >> ./work/build/Makefile_Config_Proc ; \ echo "CPPFLAGS += -DPROCPS" >> ./work/build/Makefile_Config_Proc ; \ fi \ fi gfortran source/hdf5FCInterop.F90 -o ./work/build/hdf5FCInterop.exe -ffree-line-length-none -frecursive -DBUILDPATH=\'./work/build\' -J./work/build/moduleBuild/ -I./work/build/ -fintrinsic-modules-path /usr/local/finclude -fintrinsic-modules-path /usr/local/include/gfortran -fintrinsic-modules-path /usr/local/include -fintrinsic-modules-path /usr/lib/gfortran/modules -fintrinsic-modules-path /usr/include/gfortran -fintrinsic-modules-path /usr/include -fintrinsic-modules-path /usr/finclude -fintrinsic-modules-path /usr/lib64/gfortran/modules -fintrinsic-modules-path /usr/lib64/openmpi/lib -pthread -Wall -fbacktrace -ffpe-trap=invalid,zero,overflow -fdump-core -O3 -ffinite-math-only -fno-math-errno -fopenmp -g -DOFDUNAVAIL -DFFTW3UNAVAIL -DANNUNAVAIL -DMATHEVALUNAVAIL gcc source/hdf5FCInteropC.c -o ./work/build/hdf5FCInteropC.exe -DBUILDPATH=\'./work/build\' -I./source/ -I./work/build/ -fopenmp -g -DOFDLOCKS -DOFDUNAVAIL clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' ./scripts/build/moduleDependencies.pl pwd gcc source/hdf5FCInteropC.c -o ./work/build/hdf5FCInteropC.exe -DBUILDPATH=\'./work/build\' -I./source/ -I./work/build/ -fopenmp -g -DOFDLOCKS -DOFDUNAVAIL clang: error: unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp'

abensonca commented 2 years ago

It looks like it's trying to run clang, so I assume you're trying to build Galacticus on a Mac? If so, we've only just recently gotten this to work, so there may still be some issues to work out. Are you following the instructions at https://github.com/galacticusorg/galacticus/wiki/Installation-from-source-on-MacOS ?

liempi commented 2 years ago

I didn't see this, I'll try again! thanks.

abensonca commented 2 years ago

Sounds good! Let me know if you run into problems, or if it's successful.

abensonca commented 2 years ago

Also, there's an experimental precompiled executable for MacOS that may be useful: https://github.com/galacticusorg/galacticus/wiki/Using-Precompiled-Binaries-on-MacOS

liempi commented 2 years ago

Tutorial didn't work and the precompiled said that Galacticus.exe is a Microsoft executable. I don't know what is wrong

abensonca commented 2 years ago

Can you provide details of what didn't work when you tried to build? And what's the full error message you get when trying to run the pre-compiled binary?

Xiaolong-Du commented 2 years ago

@liempi I just did some tests on the pre-compiled binary for MacOS. The test runs fine. If you follow step 1 and step 2 as shown in the Tutorial Andrew mentioned above. You should get all the necessary files. I am not sure why the command "Curl" does not work for me. But anyway, you need to download the "Galacticus" repository and "datasets" repository to run the quick test in step 2.

The zip file containing precompiled executable does not include the static dataset, so you will need to copy the "datasets/static" folder from step 1 to "datasets" you get from the zip file.

The parameter file for the quick test, "quickTest.xml", is included in the source file of Galacticus from step 1, so you need to copy the "parameters" folder from step 1 to where you have the file Galacticus.exe.

If you have all the files mentioned above, you can run the quick test as shown in Tutorial:

./Galacticus.exe parameters/quickTest.xml

When you run this for the first time, you will get a message that "Galacticus.exe can not be opened because the developer cannot be verified". Just click "cancel". Go to "System Preferences"->"Security & Privacy" ->"General", where you will see "Galacticus.exe was blocked ...". Click "Allow anyway". Then try to rerun Galactiuus. You may again get similar error message, but for another executable file. Repeat the above steps to allow the executable to run. After a few attempts, you should be able to run the test. Note that if you get error message related to "datasets", try removing all the files under "datasets/dynamic/intergalacticMedium" and "datasets/dynamic/largeScaleStructure".

I hope this can solve the problem you met.

abensonca commented 2 years ago

Thanks @Xiaolong-Du - I will update the installation notes to include these points.

liempi commented 2 years ago

Sorry for the delay, I found my error. When I try to install hdf5 the log file returns: ./configure: line 3453: gcc-11.2: command not found

so, I think the problem is with the gcc installation but the installation of gcc is ok.

liempi commented 2 years ago

@liempi I just did some tests on the pre-compiled binary for MacOS. The test runs fine. If you follow step 1 and step 2 as shown in the Tutorial Andrew mentioned above. You should get all the necessary files. I am not sure why the command "Curl" does not work for me. But anyway, you need to download the "Galacticus" repository and "datasets" repository to run the quick test in step 2.

The zip file containing precompiled executable does not include the static dataset, so you will need to copy the "datasets/static" folder from step 1 to "datasets" you get from the zip file.

The parameter file for the quick test, "quickTest.xml", is included in the source file of Galacticus from step 1, so you need to copy the "parameters" folder from step 1 to where you have the file Galacticus.exe.

If you have all the files mentioned above, you can run the quick test as shown in Tutorial:

./Galacticus.exe parameters/quickTest.xml

When you run this for the first time, you will get a message that "Galacticus.exe can not be opened because the developer cannot be verified". Just click "cancel". Go to "System Preferences"->"Security & Privacy" ->"General", where you will see "Galacticus.exe was blocked ...". Click "Allow anyway". Then try to rerun Galactiuus. You may again get similar error message, but for another executable file. Repeat the above steps to allow the executable to run. After a few attempts, you should be able to run the test. Note that if you get error message related to "datasets", try removing all the files under "datasets/dynamic/intergalacticMedium" and "datasets/dynamic/largeScaleStructure".

I hope this can solve the problem you met.

liempi@MacBook-Pro-de-Matias galacticus % sudo ./Galacticus.exe parameters/quickTest.xml

          ##                                     

© 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021

M: Memory: nodes + misc = total M:         1.000 b + 9.000 b = 10.000 b M: Memory: nodes + misc = total M:         1.000 b + 17.000 b = 18.000 b M: Memory: nodes + misc = total M:         1.000 b + 25.000 b = 26.000 b M: Memory: nodes + misc = total M:         1.000 b + 33.000 b = 34.000 b M: Memory: nodes + misc = total M:         1.000 b + 49.000 b = 50.000 b M: Memory: nodes + misc = total M:         1.000 b + 13.196kib = 13.197kib M: Memory: nodes + misc = total M:         1.000 b + 26.345kib = 26.346kib M: Memory: nodes + misc = total M:         1.000 b + 40.228kib = 40.229kib M: Memory: nodes + misc = total M:         1.000 b + 54.095kib = 54.096kib M: Memory: nodes + misc = total M:         1.000 b + 44.540kib = 44.541kib M: Memory: nodes + misc = total M:         1.000 b + 59.845kib = 59.846kib M: Memory: nodes + misc = total M:         1.000 b + 48.853kib = 48.854kib M: Memory: nodes + misc = total M:         1.000 b + 65.595kib = 65.596kib M: Memory: nodes + misc = total M:         1.000 b + 53.165kib = 53.166kib M: Memory: nodes + misc = total M:         1.000 b + 71.345kib = 71.346kib Fatal error: Unable to find data file "./static/darkMatter/Halo_Mass_Function_Parameters_Tinker_2008.xml" Occurred at: function:tinker2008ConstructorInternal file:structure_formation.halo_mass_function.Tinker2008.F90 [line 158] => Error occurred in master thread

0 0x10f00bbee

1 0x10d81c6d4

2 0x10d81c845

3 0x10e74f984

4 0x10e750a87

5 0x10e776360

6 0x10e77a374

7 0x10dd06535

8 0x10dd31b62

9 0x10dd35084

10 0x10e847894

11 0x10e8d8975

12 0x10e8e13d4

13 0x10d50d5ad

14 0x10f05c808

Program aborted. Backtrace:

0 0x10f00bbee

1 0x10f00c757

2 0x10f04a6f8

3 0x10d81c727

4 0x10d81c845

5 0x10e74f984

6 0x10e750a87

7 0x10e776360

8 0x10e77a374

9 0x10dd06535

10 0x10dd31b62

11 0x10dd35084

12 0x10e847894

13 0x10e8d8975

14 0x10e8e13d4

15 0x10d50d5ad

16 0x10f05c808

I tried and I got this in my shell, but I check the directory and the file is exactly there.

abensonca commented 2 years ago

For the pre-compiled case the problem is that Galacticus is unable to find the datasets that it needs at run time.

abensonca commented 2 years ago

Sorry for the delay, I found my error. When I try to install hdf5 the log file returns: ./configure: line 3453: gcc-11.2: command not found

so, I think the problem is with the gcc installation but the installation of gcc is ok.

It's possible that you need to set your PATH variable to include the location where gcc-11.2 was installed.

First, check whether you have gcc-11.2 in /usr/local/gcc-11.2.0/bin. If so, you can do:

export PATH=/usr/local/gcc-11.2.0/bin:$PATH

to add this location to your PATH.

I see that there's an error in the instructions for this step on the wiki page, I'll fix that now.

liempi commented 2 years ago

@abensonca Now is working, I'm gonna reinstall from the source, maybe now it will work. Thanks for your time!!