minpack
minpack copied to clipboard
Example fails with nvfortran
trafficstars
Nvidia's Fortran compiler can compile minpack, however it segfaults in the examples
❯ nvfortran --version
nvfortran 22.1-0 64-bit target on x86-64 Linux -tp haswell
NVIDIA Compilers and Tools
Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
❯ fpm run --example example_primes --compiler nvfortran --runner gdb
...
(gdb) run
Starting program: /home/awvwgk/projects/src/git/minpack/build/nvfortran_15E77B831143CB1F/example/example_primes
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00000000004028f4 in fcn () at examples/example_primes.f90:60
60 fvec = data_y - expr(data_x, x)
(gdb) bt
#0 0x00000000004028f4 in fcn () at examples/example_primes.f90:60
#1 0x000000000040ba45 in minpack_module::lmdif () at ./src/minpack.f90:2080
#2 0x000000000040d951 in minpack_module::lmdif1 () at ./src/minpack.f90:2383
#3 0x000000000040279c in find_fit_module::find_fit () at examples/example_primes.f90:48
#4 0x0000000000402ceb in example_primes () at examples/example_primes.f90:81
Looks like a problem related to nested procedures.