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

Tests failing #661

Closed
JonathanKipp opened this issue Jun 2, 2022 · 10 comments
Closed

Tests failing #661

JonathanKipp opened this issue Jun 2, 2022 · 10 comments
Labels
waiting for OP This patch requires action from the OP

Comments

@JonathanKipp
Copy link

JonathanKipp commented Jun 2, 2022

Description

compiler: any of gcc10,gcc12
OS: linux-gnu

uname -a
Linux iff1426 4.18.0-348.20.1.el8_5.x86_64 #1 SMP Thu Mar 10 20:59:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Following the instructions from README, I get a lot of failing tests when doing cmake --build build --target test (see attached file).
I ran the tests and installed succesfully on the same platform with the same compilers before i did a new git pull, but I dont remember if it was another release.

LastTest.log

Expected Behaviour

I expect the tests to run succesfully.

Version of stdlib

any from 8e0d8dd down to fb4ca80

Platform and Architecture

OS: linux-gnu >>>uname -a Linux iff1426 4.18.0-348.20.1.el8_5.x86_64 #1 SMP Thu Mar 10 20:59:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Additional Information

No response

@JonathanKipp JonathanKipp added the bug Something isn't working label Jun 2, 2022
@14NGiestas
Copy link
Member

Thank you for reporting (and sorry by the 1mo delay).
I'm not being able to reproduce the error at all.

In your log there is a lot of version GFORTRAN_10 not found which probably means something is wrong with your dynamic linker not being able to find the correct libgfortran (it's the system fault).

Could you tell more about what distro are you using? Is it a WSL?
Also could you please post the results of the following commands:

locate libgfortran
echo $LD_LIBRARY_PATH
echo $LD_PRELOAD

@14NGiestas 14NGiestas added the waiting for OP This patch requires action from the OP label Jul 5, 2022
@JonathanKipp
Copy link
Author

JonathanKipp commented Jul 11, 2022 via email

@Romendakil
Copy link

This really looks like - as was mentioned above - that the paths on your system have been changed during your building change. /lib64 does not look like a standard place where a libgfortran.so resides on a Linux system. On RedHat or Scientific Linux they reside in /usr/lib64, for Ubuntu it is in /usr/lib/x86_64-linux-gnu. Could it be that some variable that was at the head of /lib64 is missing? In any case the error message tells that the gfortran 10 version is not available/compatible with the libgfortran.so as you can see e.g. from this page: https://www.mjr19.org.uk/sw/gfortran.html

@14NGiestas
Copy link
Member

@JonathanKipp, you forgot to include the output of locate libgfortran.so (this one is really important).

Here is the output on my machine (Arch Linux):

/usr/lib/libgfortran.so
/usr/lib/libgfortran.so.5
/usr/lib/libgfortran.so.5.0.0
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/libgfortran.so
/usr/lib32/libgfortran.so
/usr/lib32/libgfortran.so.5
/usr/lib32/libgfortran.so.5.0.0

Pick one of the lines of the locate command in your machine and do (as pointed out by @Romendakil):

$ strings -a <a entry result of locate.so> | grep '^GFORTRAN_[0-9]'

Here is the output on my machine:

$ strings -a /usr/lib/libgfortran.so.5 | grep '^GFORTRAN_[0-9]'
GFORTRAN_8
GFORTRAN_9
GFORTRAN_9.2
GFORTRAN_10
GFORTRAN_10.2
GFORTRAN_12
GFORTRAN_8
GFORTRAN_10
GFORTRAN_10.2
GFORTRAN_9
GFORTRAN_9.2
GFORTRAN_12

As you can see the GFORTRAN_10 abi is supported here.

If you found the GFORTRAN_10 in any of the entries then try running it with appending a LD_LIBRARY_PATH=<path to that library> <the usual build commands>.
Otherwise, it means no libgfortran.so provides the GFORTRAN_10 ABI in which case you will need to report it to your distro, this is a bug.

If none of this helped, I suggest you fetch a fresh copy of the code (to avoid any possible conflict with build files like older "mod" files) and try again.

@JonathanKipp
Copy link
Author

JonathanKipp commented Jul 12, 2022

@14NGiestas Sorry, I forgot about the libgfortran. As you can see below, your and @Romendakil are right:

strings -a /usr/lib/gcc/x86_64-redhat-linux/4.8.2/libgfortran.so | grep '^GFORTRAN_[0-9]'
GFORTRAN_1.0
GFORTRAN_1.1
GFORTRAN_1.2
GFORTRAN_1.3
GFORTRAN_1.4
GFORTRAN_1.5

I will talk to the admins about this, thank you!

@awvwgk
Copy link
Member

awvwgk commented Jul 12, 2022

/usr/lib/gcc/x86_64-redhat-linux/4.8.2/libgfortran.so

GFortran 4.8 is missing features used in stdlib, you need at least GFortran 9 or newer.

@JonathanKipp
Copy link
Author

JonathanKipp commented Jul 12, 2022

@14NGiestas @awvwgk Hello again, below you can find the output from the locate command:

locate libgfortran.so
/usr/lib/gcc/x86_64-redhat-linux/8/libgfortran.so
/usr/lib/gcc/x86_64-redhat-linux/8/32/libgfortran.so
/usr/lib64/libgfortran.so.3
/usr/lib64/libgfortran.so.3.0.0
/usr/lib64/libgfortran.so.5
/usr/lib64/libgfortran.so.5.0.0

There is a GFORTRAN_10 on the system, but under a different path (which is not found by locate):
/usr/local/gcc10/lib64/libgfortran.so.5
The output for the strings command is:

strings -a /usr/local/gcc10/lib64/libgfortran.so.5 | grep '^GFORTRAN_[0-9]'
GFORTRAN_8
GFORTRAN_9
GFORTRAN_9.2
GFORTRAN_10
GFORTRAN_10.2
GFORTRAN_8
GFORTRAN_10
GFORTRAN_10.2
GFORTRAN_9
GFORTRAN_9.2

I tried giving this to cmake with LD_LIBRARY_PATH as suggested, but still the tests fail:

LD_LIBRARY_PATH="/usr/local/gcc10/lib64/libgfortran.so.5" cmake -B build -DCMAKE_INSTALL_PREFIX="${HOME}/.local/stdlib_gnu"
LD_LIBRARY_PATH="/usr/local/gcc10/lib64/libgfortran.so.5" cmake --build build -j 4
LD_LIBRARY_PATH="/usr/local/gcc10/lib64/libgfortran.so.5" cmake --build build --target test

@awvwgk
Copy link
Member

awvwgk commented Jul 12, 2022

The /usr/local prefix is special on Linux, specially with regard to loading libraries. Installing a compiler there is usually asking for trouble.

If you have installed GFortran 10 yourself there, consider removing it from the prefix again and install it differently to save yourself trouble in the future. To get GFortran 10 either try a package from your package manager (https://rockylinux.pkgs.org/8/rockylinux-appstream-x86_64/gcc-toolset-10-toolchain-10.1-0.el8.x86_64.rpm.html).

If you want to install the compiler only locally, you can use conda-forge:

wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
sh Mambaforge-Linux-x86_64.sh
exec $SHELL
mamba create -n gcc10 'gcc=10.*' 'g++=10.*' 'gfortran=10.*'

Than you can activate your compiler with mamba activate gcc10 and setup your CMake build with

cmake $CMAKE_ARGS -B build ...

This should provide you with a proper compiler setup, which produces libraries even if the compiler environment is not loaded.

@14NGiestas
Copy link
Member

Hi @JonathanKipp, your LD_LIBRARY_PATH should be a path-to-a-folder not a path-to-a-file, you should try this instead:

LD_LIBRARY_PATH="/usr/local/gcc10/lib64/" cmake -B build -DCMAKE_INSTALL_PREFIX="${HOME}/.local/stdlib_gnu"
LD_LIBRARY_PATH="/usr/local/gcc10/lib64/" cmake --build build -j 4
LD_LIBRARY_PATH="/usr/local/gcc10/lib64/" cmake --build build --target test

This way you may be able to compile and test the stdlib in your system's current state, but you should look for a permanent solution.

@14NGiestas 14NGiestas removed the bug Something isn't working label Jul 12, 2022
@IngoMeyer441
Copy link

I also tried to run the tests in @JonathanKipp's working environment. Setting LD_LIBRARY_PATH="/usr/local/gcc10/lib64/" indeed works. However, we will alter the compiler setup to reference its libgfortran.so by an absolute path, so setting environment variables won't be necessary in the future. Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for OP This patch requires action from the OP
Projects
None yet
Development

No branches or pull requests

5 participants