issp-center-dev / HPhi

Quantum Lattice Model Simulator Package
https://www.pasums.issp.u-tokyo.ac.jp/hphi/en/
GNU General Public License v3.0
82 stars 25 forks source link

Problem with installation #93

Closed malga94 closed 4 years ago

malga94 commented 4 years ago

Hi,

I am trying to install HPhi on a MacBook Pro running macOS 10.13.6. I am following exactly the instructions given in the release note of the last version (3.3.1). Everything goes fine until the make command. cmake seems to run properly and produces a Makefile, but then when i run make i encounter an error:

Undefined symbols for architecture x86_64

which appears to be related to an issue in compiling some fortran programs. I will attach a screenshot of the error below. Quick search on the web for this error gave me no clues on how to proceed. Any help is much appreciated! Thank you

Screen Shot 2020-03-21 at 17 40 02

wistaria commented 4 years ago

I suspect that the detection of the LAPACK library failed during cmake. Could you post the log of cmake?

malga94 commented 4 years ago

Sure, here's what happens when I run cmake:

Screen Shot 2020-03-23 at 01 48 23

and here is the CMakeError.log file

CMakeError.log

wistaria commented 4 years ago

CMake found Accelerate framework correctly, but compile fails. Strange. Could you try 'make VERBOSE=1' and send me the output?

malga94 commented 4 years ago

Yes, below is a txt file with all the output of make with VERBOSE=1: make_output.txt

I don't know if it's relevant, but have you noticed: "Looking for Fortran sgemm - not found" in the cmake output?

k-yoshimi commented 4 years ago

@malga94 From your make_output.txt, I found that -framework Accelerate -lm was missed. I also use MacBook Pro running macOS 10.13.6 and succeeded to compile HPhi by the following command without MPI:

$ cmake ../HPhi-3.3.1 -DENABLE_MPI=OFF
-- Build type: Release
-- The C compiler identification is AppleClang 10.0.0.10001145
-- The Fortran compiler identification is GNU 9.3.0
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Check for working Fortran compiler: /usr/local/bin/gfortran
-- Check for working Fortran compiler: /usr/local/bin/gfortran  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/local/bin/gfortran supports Fortran 90
-- Checking whether /usr/local/bin/gfortran supports Fortran 90 -- yes
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Found OpenMP_Fortran: -fopenmp (found version "4.5")
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND) (found version "4.5")
-- Looking for Fortran dgemm
-- Looking for Fortran dgemm - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Found BLAS: /System/Library/Frameworks/Accelerate.framework
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- A library with LAPACK API found.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/k-yoshimi/program/test_HPhi/build

ref.) makeoutput.txt

To see the possibility that cmake of HPhi will not work properly without MPI, could you add the option -DENABLE_MPI = OFF to cmake and compile it ?

malga94 commented 4 years ago

@k-yoshimi I tried your suggestion. Unfortunately I still get the same error as before when running make. Here is the output of cmake with the -DENABLE_MPI option:

Screen Shot 2020-03-24 at 16 45 23

k-yoshimi commented 4 years ago

@malga94 Thank you for trying to add the option. So, please upload following files by zip file ?

k-yoshimi commented 4 years ago

@malga94 I think that -framework Accelerate -lm is not existed in the last line in your link.txt. If not existed, please add this directly to each link.txt and try to do make again?

malga94 commented 4 years ago

Indeed, -framework Accelerate was missing from the three link.txt files you mentioned. Once I added it manually at the end of each file, running make works perfectly.

Thank you so much for your help! Looking forward to using HPhi. I'm now going to mark the issue as closed

k-yoshimi commented 4 years ago

@malga94 It was good to work well. To see why cmake fails to add -framework Accelerate to link.txt, could you tell me the version number of cmake ? You can see the version number by typing cmake --version. Thank you in advance for your corporation.

malga94 commented 4 years ago

Of course, it is cmake version 3.16.0-rc2