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

[SciPy]: Getting trouble while building #9

Open
Pranavchiku opened this issue Oct 10, 2022 · 3 comments
Open

[SciPy]: Getting trouble while building #9

Pranavchiku opened this issue Oct 10, 2022 · 3 comments

Comments

@Pranavchiku
Copy link

Pranavchiku commented Oct 10, 2022

I tried to build this on my PC (ubuntu 22.04 linux) and it shows me the following logs on executing FC = lfortran cmake .

-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The Fortran compiler identification is unknown
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - failed
-- Check for working Fortran compiler: /home/pranavchiku/lfortran/src/bin/lfortran
-- Check for working Fortran compiler: /home/pranavchiku/lfortran/src/bin/lfortran - broken
CMake Error at /home/pranavchiku/conda_root/envs/lf/share/cmake-3.24/Modules/CMakeTestFortranCompiler.cmake:61 (message):
  The Fortran compiler

    "/home/pranavchiku/lfortran/src/bin/lfortran"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/pranavchiku/minpack/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_d141a/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_d141a.dir/build.make CMakeFiles/cmTC_d141a.dir/build
    gmake[1]: Entering directory '/home/pranavchiku/minpack/CMakeFiles/CMakeTmp'
    Building Fortran object CMakeFiles/cmTC_d141a.dir/testFortranCompiler.f.o
    /home/pranavchiku/lfortran/src/bin/lfortran    -c /home/pranavchiku/minpack/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTC_d141a.dir/testFortranCompiler.f.o
    Linking Fortran executable cmTC_d141a
    /home/pranavchiku/conda_root/envs/lf/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d141a.dir/link.txt --verbose=1
    /home/pranavchiku/lfortran/src/bin/lfortran CMakeFiles/cmTC_d141a.dir/testFortranCompiler.f.o -o cmTC_d141a 
    /home/pranavchiku/conda_root/envs/lf/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/pranavchiku/lfortran/src/bin/../runtime/liblfortran_runtime.so: undefined reference to `clock_gettime'
    clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
    The command 'clang -o cmTC_d141a CMakeFiles/cmTC_d141a.dir/testFortranCompiler.f.o  -L"/home/pranavchiku/lfortran/src/bin/../runtime" -Wl,-rpath,"/home/pranavchiku/lfortran/src/bin/../runtime" -llfortran_runtime -lm' failed.
    gmake[1]: *** [CMakeFiles/cmTC_d141a.dir/build.make:99: cmTC_d141a] Error 10
    gmake[1]: Leaving directory '/home/pranavchiku/minpack/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:127: cmTC_d141a/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:6 (enable_language)

@certik if you could look, I am trying to resolve it as soon as possible :)

@Pranavchiku
Copy link
Author

Pranavchiku commented Oct 10, 2022

build successfully works with gfortran, till the error is resolved I am compiling minpack directly from scipy ( the files that are present in scipy)

@certik
Copy link
Owner

certik commented Oct 10, 2022

The following fails on your system:

     /home/pranavchiku/lfortran/src/bin/lfortran CMakeFiles/cmTC_d141a.dir/testFortranCompiler.f.o -o cmTC_d141a 
    /home/pranavchiku/conda_root/envs/lf/bin/../lib/gcc/x86_64-conda-linux-gnu/12.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/pranavchiku/lfortran/src/bin/../runtime/liblfortran_runtime.so: undefined reference to `clock_gettime'
    clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

Which is a bug in LFortran, something in the Conda environment and the way cmake invokes LFortran break things.

Which compiler did you use to compile LFortran?

@Pranavchiku
Copy link
Author

Pranavchiku commented Oct 10, 2022

Which compiler did you use to compile LFortran?

clang

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

2 participants