Fpm: build script="make all" no longer works

Created on 21 Jan 2021  路  5Comments  路  Source: fortran-lang/fpm

About a year ago, I was able to compile of complex project of mine using a pre-existing Makefile. After finding out about the environment variables $BUILD_DIR and $FC, this was pretty easy, I only needed to specify the following:

[library]
build-script = "make all F95=$FC LIBPATH=$BUILD_DIR MODPATH=$BUILD_DIR"

However, I just updated to the latest alpha version (0.1.3), and this does't seem to work anymore: the makefile is not being executed and instead fpm is trying to compile the file in the src directory.

Is there a way to specify using a prexisting makefile, or a way pass optional variables to the Makefile?

Most helpful comment

I'm using the Fortran client. Should the Haskell version be the default? or is the plan to make the Fortran version the default?

So, I am guessing the answer is: Check back later

That's fine with me. However, I just want to emphasize that if you want old, or complicated projects to work with fpm, eventually, you will need to pass environment variables to the makefile!

All 5 comments

Are you using the Haskell (fpm-haskell-0.1.3) or Fortran (fpm-0.1.3) client? This is not yet implemented in the latter.

Hello @MarkWieczorek,

note the build-script was an "experimental" feature available in the bootstrap fpm (the Haskell version). In the meantime a Fortran version of fpm has been built. You can check the manifest reference to see what is available.

Executables for the Haskell version can be found in the assets section of the latest release.

A specification for the build-script feature is currently under discussion in https://github.com/fortran-lang/fpm/issues/249.

I'm using the Fortran client. Should the Haskell version be the default? or is the plan to make the Fortran version the default?

So, I am guessing the answer is: Check back later

That's fine with me. However, I just want to emphasize that if you want old, or complicated projects to work with fpm, eventually, you will need to pass environment variables to the makefile!

The Fortran version is (and will remain) the default. The build script is just one of the features which hasn't been implemented yet in the Fortran version.

Thanks for the feedback @MarkWieczorek. Support for a custom build script is one of two (big) priority items remaining in our milestone . I'll close this issue as a duplicate of #219.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smeskos picture smeskos  路  7Comments

awvwgk picture awvwgk  路  5Comments

awvwgk picture awvwgk  路  10Comments

awvwgk picture awvwgk  路  7Comments

certik picture certik  路  10Comments