Skip to content

Conversation

JorgeG94
Copy link

test-drive was not compiling with lfortran (0.57) due to:

fpm test --compiler lfortran --profile debug --flag "--cpp"
test_select.F90                        done.
test_check.F90                         done.
main.f90                               done.
test-drive-test                        failed.
[100%] Compiling...
/home/jorge/install/miniconda3/envs/pic/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: build/lfortran_68E2630F1735BEB5/test-drive/test_main.f90.o: in function `__module_test_check_test_cdp_nan':
LFortran:(.text+0x1015d): undefined reference to `ieee_quiet_nan'
/home/jorge/install/miniconda3/envs/pic/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: build/lfortran_68E2630F1735BEB5/test-drive/test_main.f90.o: in function `__module_test_check_test_cdp_nan_message':
LFortran:(.text+0x10264): undefined reference to `ieee_quiet_nan'
/home/jorge/install/miniconda3/envs/pic/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: build/lfortran_68E2630F1735BEB5/test-drive/test_main.f90.o: in function `__module_test_check_test_csp_nan':
LFortran:(.text+0x10f3c): undefined reference to `ieee_quiet_nan'
/home/jorge/install/miniconda3/envs/pic/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: build/lfortran_68E2630F1735BEB5/test-drive/test_main.f90.o: in function `__module_test_check_test_csp_nan_message':
LFortran:(.text+0x11043): undefined reference to `ieee_quiet_nan'
/home/jorge/install/miniconda3/envs/pic/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: build/lfortran_68E2630F1735BEB5/test-drive/test_main.f90.o: in function `__module_test_check_test_rdp_nan':
LFortran:(.text+0x129a5): undefined reference to `ieee_quiet_nan'
/home/jorge/install/miniconda3/envs/pic/bin/../lib/gcc/x86_64-conda-linux-gnu/15.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: build/lfortran_68E2630F1735BEB5/test-drive/test_main.f90.o:LFortran:(.text+0x12a6c): more undefined references to `ieee_quiet_nan' follow
collect2: error: ld returned 1 exit status

A simple test requiring quiet_nan worked separately. That is why I had to add use the use, intrinsic :: ieee_arithmetic, only: ieee_quiet_nan in the main for tests.

After that, you'd get runtime failures saying that testsuite(s) was not allocated. That was duct tape fixed by adding the allocate. I believe this are probably lfortran bugs. I am just opening this to showcase what caused the errors.

@JorgeG94
Copy link
Author

I've created two MREs and opened issues in lfortran :)

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

Successfully merging this pull request may close these issues.

1 participant