FPM creates the binary/executable of a code in the subdirectories of the build directory, named with the compiler and eventually with the subdirectory “app”.
I search fortran-lang page and FPM tutorial, etc and I could not find a solution such that I can specify the target directory of the executable or a way of making a soft link into a preferred directory. I know that it can be done by a bash or some other way, but I would rather do this through FPM so that the last step would be “fpm build”.
I appreciate any comment!
You cannot do a soft link, but you can use the
fpm install --prefix=/path/to/end/folder
Thanks very much for your comment.
Actually, I have used “fpm install --prefix” for a part of my code, prior to the main part. For that smaller part, I see that everything is being copied including *.o and *.mod files. Therefore, these files are duplicated, while I am interested only in having the binary file in a proper location.
Nevertheless, I agree that “fpm install” is a nice way since the package can be used as a library for another package.
fpm should only install the executables unless you turn
install.library on in the manifest:
please, check that in your fpm.toml:
library = false
or that there is no such key
Thanks a lot!
The combination of
–prefix and --bindir when using “fpm install” does what I needed.