esmf-org / esmf

The Earth System Modeling Framework (ESMF) is a suite of software tools for developing high-performance, multi-component Earth science modeling applications.
https://earthsystemmodeling.org/
Other
156 stars 75 forks source link

[Question] packaging w/o ESMF_DIR #238

Open waarmond opened 5 months ago

waarmond commented 5 months ago

I would like to write an AUR PKGBUILD for esmf. The build step is working absolutely flawless.

ArchLinux creates a work-copy, then builds in the srcdir, installs with DESTDIR to the pkgdir and then tarfiles that. ├── esmf = repo clone ├── pkg │   └── esmf └── src │   └── esmf = builddir

prepare() {
    export ESMF_DIR=$srcdir/esmf/
}

build() {
    cd "$pkgname"
    make
}

package() {
    cd "$pkgname"
    make DESTDIR="$pkgdir/" install
}

How may I outsmart ESMF_DIR which doesn't want to be changed during the build process?

PS: The build() step can't write to $pkgdir yet. I would need a different ESMF_DIR for each step.

mathomp4 commented 5 months ago

@waarmond Are you asking how to install to a different place? You can set ESMF_INSTALL_PREFIX and that determines where ESMF is installed. I'm not sure ESMF knows about DESTDIR at all...

waarmond commented 3 months ago

I've now succeeded in packaging it.

Are there any negative repercussions of having the binaries at /usr/bin instead of /usr/bin/binO/Linux.gfortran.64.mpiuni.default ?

mathomp4 commented 3 months ago

@waarmond Shouldn't be if you do make install. I think ESMF's make system will rewrite things like esmf.mk to point to the right places. Heck, I maintain a set of libraries that install to a bit of oddness (due to historical reasons):

  ESMF_INSTALL_PREFIX    ?= $(prefix)
  ESMF_INSTALL_HEADERDIR ?= $(prefix)/include/esmf
  ESMF_INSTALL_MODDIR    ?= $(prefix)/include/esmf
  ESMF_INSTALL_LIBDIR    ?= $(prefix)/lib
  ESMF_INSTALL_BINDIR    ?= $(prefix)/bin