Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccurate Compile Instructions #273

Open
JonathonMisiewicz opened this issue Nov 11, 2021 · 7 comments
Open

Inaccurate Compile Instructions #273

JonathonMisiewicz opened this issue Nov 11, 2021 · 7 comments

Comments

@JonathonMisiewicz
Copy link
Contributor

The install instructions in README.md don't mention that Boost needs to already be installed before you can install Forte. I had to install that myself (after resolving some conda conflicts) before I could attempt a compile.

@fevangelista

@vijaymocherla
Copy link

vijaymocherla commented Dec 6, 2021

I've had the same issue. For some reason, I couldn't find CMake files for ambit from psi4 installation. Then I decided to build ambit from source, but after that when I'm trying to build forte, it has an issue with the version of HDF5 library.
CMake shows the following error message:

CMake Error at /usr/local/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find TargetHDF5: Found unsuitable version "1.10.6", but required
  is exact version "1.10.4" (found Found HDF5:.....

Can anyone please suggest a fix to this issue?

@lcyyork
Copy link
Contributor

lcyyork commented Dec 6, 2021

I think if you install ambit via conda, the directory should be the conda environment directory. Inside the directory, you will find ambit related files inside lib, include, and share.

For the second message, it is likely different HDF5 was used to compile Psi4 and Ambit.

@vijaymocherla
Copy link

I have tried to build psi4 from scratch with intel compilers(icx/icpx), and forte seems to issues with them.

@lcyyork
Copy link
Contributor

lcyyork commented Dec 7, 2021

Sorry, I am a bit confused. Is this a new issue related to ambit or not? I do not think the HDF5 problem has anything to do with compilers. Please provide both the outputs when you type cmake and make so that I can help. Otherwise, I can only guess the compiler you are using does not support c++17.

@vijaymocherla
Copy link

vijaymocherla commented Dec 8, 2021

Here's my output from cmake:

loading initial cache file /home/dwave/src-pkgs/psi4/build-debug/stage/share/cmake/psi4/psi4PluginCache.cmake
-- Setting option ENABLE_CheMPS2: OFF
-- Setting option ENABLE_OPENMP: ON
-- Setting option ENABLE_MPI: OFF
-- Setting option ENABLE_GA: OFF
-- Setting option MAX_DET_ORB: 64
-- Setting option ENABLE_CODECOV: OFF
-- Setting option ENABLE_UNTESTED_CODE: OFF
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Psi4 script:   /home/dwave/src-pkgs/psi4/build-debug/stage/bin/psi4
-- Psi4 headers:  /home/dwave/src-pkgs/psi4/build-debug/stage/include
-- Psi4 library:  /home/dwave/src-pkgs/psi4/build-debug/stage/lib//psi4/core.cpython-38-x86_64-linux-gnu.so
-- Psi4 sys.path: /home/dwave/src-pkgs/psi4/build-debug/stage/lib/
-- Psi4 components: 
-- Python executable: /home/dwave/anaconda3/envs/p4dev/bin/python
-- Found Python: /home/dwave/anaconda3/envs/p4dev/bin/python (found suitable version "3.8.12", minimum required is "3.6") found components: Interpreter Development NumPy Development.Module Development.Embed 
-- Found pybind11: /home/dwave/src-pkgs/psi4/build-debug/stage/include (found version "2.7.0" )
-- Detecting MathOpenMP -- ?OpenMP=ON, ?MKL=, LANG=CXX, C/CXX/Fortran=GNU/GNU/
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5") found components: CXX 
-- Libint2Config components requested: 
-- Libint2Config components found: e2;e3;e4;e5;e6;e7;eri2_e2;eri2_e3;eri2_e4;eri2_e5;eri2_e6;eri2_e7;eri2_g2;eri2_g3;eri2_g4;eri2_g5;eri2_g6;eri2_g7;eri2_h2;eri2_h3;eri2_h4;eri2_h5;eri3_e2;eri3_e3;eri3_e4;eri3_e5;eri3_e6;eri3_e7;eri3_g2;eri3_g3;eri3_g4;eri3_g5;eri3_g6;eri3_g7;eri3_h2;eri3_h3;eri3_h4;eri3_h5;g2;g3;g4;g5;g6;g7;gss;h2;h3;h4;shared
-- Found Python: /home/dwave/anaconda3/envs/p4dev/bin/python (found version "3.8.12") found components: Interpreter Development Development.Module Development.Embed 
-- TargetLAPACKConfig detected.
-- HDF5 detected.
-- Git current branch: master
-- Git commit hash: 8aa9a2e8
-- Generating version.h
-- Adding SSE4.2 Flag
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dwave/src-pkgs/forte

and the output from make:

Consolidate compiler generated dependencies of target forte_benchmarks
[  2%] Built target forte_benchmarks
Consolidate compiler generated dependencies of target forte_tests
[  4%] Built target forte_tests
Consolidate compiler generated dependencies of target forte
[  4%] Linking CXX shared module forte.cpython-38-x86_64-linux-gnu.so
/usr/bin/ld: cannot find /lib64/libpthread.so.0
/usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a
collect2: error: ld returned 1 exit status
make[2]: *** [forte/CMakeFiles/forte.dir/build.make:2461: forte/forte.cpython-38-x86_64-linux-gnu.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:154: forte/CMakeFiles/forte.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Note: I have psi4 installed within the current conda environment.

@lcyyork
Copy link
Contributor

lcyyork commented Dec 9, 2021

@vijaymocherla Thanks for the input. However, the cmake output seems incomplete. Would you mind to first remove CMakeCache.txt and CMakeFiles and then run cmake -D... again (or run python setup.py develop)?

I have not compiled with Psi4 nor Forte using intel compilers. But I did use gcc on Linux and clang on MacOS a couple of days ago. By the way, the same compilers should be used to compile Psi4 and Forte. You may want to checkout how Forte is built on azure pipeline.

@vijaymocherla
Copy link

vijaymocherla commented Dec 11, 2021

@lcyyork I've tried compiling forte with intel compilers(oneAPI or otherwise) a couple of times, but unfortunately all of them fell through. I could finally compile, a copy with gcc.

Here's what worked for me on linux, it follows @fevangelista 's recent post, that has a recipe to build forte on macOS.

# create a fresh conda environment 
conda create -n forte
conda install psi4-dev python=3.8 -c psi4/label/dev
cd ~/software

# clone psi4 repo
git clone https://www.github.com/psi4/psi4
cd psi4
psi4-path-advisor --gcc
cmake (whatever you get from path-advisor)
cd objdir && make -j(num cores to compile)
cd stage/bin/ && ./psi4 --psiapi-path # copy the output to .bashrc  
# install some dependencies needed for psi4
conda install -c conda-forge pythreejs
conda install nodejs -c conda-forge --repodata-fn=repodata.json
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-threejs
# clone forte
cd ~/software/
git clone https://github.com/evangelistalab/forte
cd forte
psi4 --plugin-compile

# use the output to compile forte with 
#	-Dambit_DIR=$ambit_dir \
#	-DCMAKE_BUILD_TYPE=$build_type \
#	-DENABLE_ForteTests=TRUE
# you can find $ambit_dir with $ locate share/cmake/ambit
# it should be some where inside you conda (path to conda)/envs.

$ cmake `psi4 --plugin-compile` -Dambit_DIR=$ambit_dir \
	-DCMAKE_BUILD_TYPE=RelwithDebInfo \
	-DENABLE_ForteTests=TRUE
$ make -j(num cores to compile)	

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants