hrue / r-inla

This is the public repository for the r-inla project
GNU General Public License v2.0
88 stars 24 forks source link

source distribution of inla #96

Closed edzer closed 6 months ago

edzer commented 6 months ago

Are there somewhere instructions for a full source build of r-inla, including the inla binaries? I could only find binary install instructions from https://www.r-inla.org/download-install

edzer commented 6 months ago

Ah, I found some makefiles in r-inla/build-configs/linux, however

hg clone https://bitbucket.org/hrue/r-inla

gives an

abort: HTTP Error 404: Not Found
hrue commented 6 months ago

They are not very upgraded. Which OS you want to build for ?

On Tue, 2024-04-30 at 00:45 -0700, Edzer Pebesma wrote:

Ah, I found some makefiles in r-inla/build-configs/linux — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Håvard Rue Professor of Statistics Chair of the Statistics Program CEMSE Division King Abdullah University of Science and Technology Thuwal 23955-6900 Kingdom of Saudi Arabia

@.*** Office: +966 (0)12 808 0640   Mobile: +966 (0)54 470 0421 Research group: bayescomp.kaust.edu.sa   R-INLA project: www.r-inla.org Zoom: kaust.zoom.us/my/haavard.rue

--

This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.

edzer commented 6 months ago

For linux (I'm on ubuntu 22.04)

hrue commented 6 months ago

with

inla.binary.install()

you can install 22.04 builds

On Tue, 2024-04-30 at 03:31 -0700, Edzer Pebesma wrote:

For linux (I'm on ubuntu 22.04) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

-- Håvard Rue Professor of Statistics Chair of the Statistics Program CEMSE Division King Abdullah University of Science and Technology Thuwal 23955-6900 Kingdom of Saudi Arabia

@.*** Office: +966 (0)12 808 0640   Mobile: +966 (0)54 470 0421 Research group: bayescomp.kaust.edu.sa   R-INLA project: www.r-inla.org Zoom: kaust.zoom.us/my/haavard.rue

--

This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.

hrue commented 6 months ago

you can download the build tree I use for Ubuntu 2204

hrue.r-inla-download.org/build64.tgz

if you want to compile it yourself

On Tue, 2024-04-30 at 03:31 -0700, Edzer Pebesma wrote:

For linux (I'm on ubuntu 22.04) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

-- Håvard Rue Professor of Statistics Chair of the Statistics Program CEMSE Division King Abdullah University of Science and Technology Thuwal 23955-6900 Kingdom of Saudi Arabia

@.*** Office: +966 (0)12 808 0640   Mobile: +966 (0)54 470 0421 Research group: bayescomp.kaust.edu.sa   R-INLA project: www.r-inla.org Zoom: kaust.zoom.us/my/haavard.rue

--

This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.

edzer commented 6 months ago

Thanks. The first command, make download stops with

error: branch 'tag-' not found.
Fetching origin
Already up to date.
fatal: 'tags/' is not a commit and a branch 'tag-' cannot be created from it
Your branch is up to date with 'origin/devel'.

I guess because I didn't set the env. variable INLA_TAG. How should this be set?

Make taucs succeeded (after I changed gcc-12 to gcc-11 in GNUMakefile, and created directory /home/edzer/builds/build64/local/lib/).

make GMRFLib failed here:

ccache gcc-11 -I.. -I/home/edzer/builds/build64/local/include -DGMRFLib_PATH=\"/home/edzer/builds/build64/local/doc/GMRFLib/data\"  -I/home/edzer/builds/build64/local/include -O3 -ftree-vectorize -DINLA_WITH_PARDISO -funroll-loops -fvariable-expansion-in-unroller -Wall -Wextra -fopenmp -fopenmp-simd -pipe -pthread -fopenmp -I/usr/local/include -I/usr/include/suitesparse -DGITCOMMIT="\"111175339d876568768a24f2b94df2cc7904b2c5 - Wed May 1 21:31:01 2024 +0300\""   -c -MMD -MF .deps/fsort.d.tmp -o fsort.o fsort.c
In file included from fsort.c:36:
GMRFLib/fsort/fluxsort.h:45:10: fatal error: GMRFLib/fsort/quadsort.h: No such file or directory
   45 | #include "GMRFLib/fsort/quadsort.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:102: fsort.o] Error 1
make[1]: *** Waiting for unfinished jobs....
rm -f .deps/design.d.tmp
rm -f .deps/approx-inference--classic.d.tmp
make[1]: Leaving directory '/tmp/hr/build64/r-inla/gmrflib'
make: *** [GNUmakefile:75: GMRFLib] Error 2

any ideas how to get beyond that point?

The GNUmakefile suggests as final target to make inla, I guess that should be make inla.mkl? Anyway, trying to make inla.mkl it also breaks at

ccache g++-11 -I.. -I/home/edzer/builds/build64/local/include -DGMRFLib_PATH=\"/home/edzer/builds/build64/local/doc/GMRFLib/data\"  -I/home/edzer/builds/build64/local/include -O3 -ftree-vectorize -DINLA_WITH_PARDISO -funroll-loops -fvariable-expansion-in-unroller -Wall -Wextra -fopenmp -fopenmp-simd -pipe -pthread -DINLA_WITH_MKL -fopenmp -I/usr/local/include -I/usr/include/suitesparse -DGITCOMMIT="\"111175339d876568768a24f2b94df2cc7904b2c5 - Wed May 1 21:31:01 2024 +0300\""   -c -o high-prec-timer.o high-prec-timer.cpp
ccache gcc-11 -I.. -I/home/edzer/builds/build64/local/include -DGMRFLib_PATH=\"/home/edzer/builds/build64/local/doc/GMRFLib/data\"  -I/home/edzer/builds/build64/local/include -O3 -ftree-vectorize -DINLA_WITH_PARDISO -funroll-loops -fvariable-expansion-in-unroller -Wall -Wextra -fopenmp -fopenmp-simd -pipe -pthread -DINLA_WITH_MKL -fopenmp -I/usr/local/include -I/usr/include/suitesparse -DGITCOMMIT="\"111175339d876568768a24f2b94df2cc7904b2c5 - Wed May 1 21:31:01 2024 +0300\""   -c -MMD -MF .deps/fsort.d.tmp -o fsort.o fsort.c
In file included from fsort.c:36:
GMRFLib/fsort/fluxsort.h:45:10: fatal error: GMRFLib/fsort/quadsort.h: No such file or directory
   45 | #include "GMRFLib/fsort/quadsort.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:102: fsort.o] Error 1
make[1]: Leaving directory '/tmp/hr/build64/r-inla/gmrflib'
make: *** [GNUmakefile:62: inla.mkl] Error 2

Any help would be appreciated!

barryrowlingson commented 6 months ago

I think step 0 here would be to make a clean version of build64.tgz - it has a lot of binary objects in there - .so, .o, .a, .lib, .dylib etc, which look like hangovers from previous builds and other possibly non-open binaries.

edzer commented 6 months ago

Yeah, I did a

rm `find . -name *.so`
rm `find . -name *.o`

before I started.

barryrowlingson commented 6 months ago

You may need to be a bit more aggressive. That won't find versioned shareables eg libXYZ.so.1

hrue commented 6 months ago

You have to edit GNUmakefile to change some -IPATH... to where you are.

env INLA_TAG=devel make update

On Thu, 2024-05-02 at 06:29 -0700, Edzer Pebesma wrote:

Thanks. The first command, make download stops with error: branch 'tag-' not found. Fetching origin Already up to date. fatal: 'tags/' is not a commit and a branch 'tag-' cannot be created from it Your branch is up to date with 'origin/devel'. I guess because I didn't set the env. variable INLA_TAG. How should this be set? Make taucs succeeded (after I changed gcc-12 to gcc-11 in GNUMakefile, and created directory /home/edzer/builds/build64/local/lib/). make GMRFLib failed here: ccache gcc-11 -I.. -I/home/edzer/builds/build64/local/include - DGMRFLib_PATH=\"/home/edzer/builds/build64/local/doc/GMRFLib/data\" - I/home/edzer/builds/build64/local/include -O3 -ftree-vectorize - DINLA_WITH_PARDISO -funroll-loops -fvariable-expansion-in-unroller -Wall - Wextra -fopenmp -fopenmp-simd -pipe -pthread -fopenmp -I/usr/local/include - I/usr/include/suitesparse - DGITCOMMIT="\"111175339d876568768a24f2b94df2cc7904b2c5 - Wed May 1 21:31:01 2024 +0300\"" -c -MMD -MF .deps/fsort.d.tmp -o fsort.o fsort.c In file included from fsort.c:36: GMRFLib/fsort/fluxsort.h:45:10: fatal error: GMRFLib/fsort/quadsort.h: No such file or directory    45 | #include "GMRFLib/fsort/quadsort.h"       | ^~~~~~ compilation terminated. make[1]: [Makefile:102: fsort.o] Error 1 make[1]: Waiting for unfinished jobs.... rm -f .deps/design.d.tmp rm -f .deps/approx-inference--classic.d.tmp make[1]: Leaving directory '/tmp/hr/build64/r-inla/gmrflib' make: [GNUmakefile:75: GMRFLib] Error 2 any ideas how to get beyond that point? The GNUmakefile suggests as final target to make inla, I guess that should be make inla.mkl? Anyway, trying to make inla.mkl it also breaks at ccache g++-11 -I.. -I/home/edzer/builds/build64/local/include - DGMRFLib_PATH=\"/home/edzer/builds/build64/local/doc/GMRFLib/data\" - I/home/edzer/builds/build64/local/include -O3 -ftree-vectorize - DINLA_WITH_PARDISO -funroll-loops -fvariable-expansion-in-unroller -Wall - Wextra -fopenmp -fopenmp-simd -pipe -pthread -DINLA_WITH_MKL -fopenmp - I/usr/local/include -I/usr/include/suitesparse - DGITCOMMIT="\"111175339d876568768a24f2b94df2cc7904b2c5 - Wed May 1 21:31:01 2024 +0300\"" -c -o high-prec-timer.o high-prec-timer.cpp ccache gcc-11 -I.. -I/home/edzer/builds/build64/local/include - DGMRFLib_PATH=\"/home/edzer/builds/build64/local/doc/GMRFLib/data\" - I/home/edzer/builds/build64/local/include -O3 -ftree-vectorize - DINLA_WITH_PARDISO -funroll-loops -fvariable-expansion-in-unroller -Wall - Wextra -fopenmp -fopenmp-simd -pipe -pthread -DINLA_WITH_MKL -fopenmp - I/usr/local/include -I/usr/include/suitesparse - DGITCOMMIT="\"111175339d876568768a24f2b94df2cc7904b2c5 - Wed May 1 21:31:01 2024 +0300\"" -c -MMD -MF .deps/fsort.d.tmp -o fsort.o fsort.c In file included from fsort.c:36: GMRFLib/fsort/fluxsort.h:45:10: fatal error: GMRFLib/fsort/quadsort.h: No such file or directory    45 | #include "GMRFLib/fsort/quadsort.h"       | ^~~~~~ compilation terminated. make[1]: [Makefile:102: fsort.o] Error 1 make[1]: Leaving directory '/tmp/hr/build64/r-inla/gmrflib' make: [GNUmakefile:62: inla.mkl] Error 2 Any help would be appreciated! — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

-- Håvard Rue Professor of Statistics Chair of the Statistics Program CEMSE Division King Abdullah University of Science and Technology Thuwal 23955-6900 Kingdom of Saudi Arabia

@.*** Office: +966 (0)12 808 0640   Mobile: +966 (0)54 470 0421 Research group: bayescomp.kaust.edu.sa   R-INLA project: www.r-inla.org Zoom: kaust.zoom.us/my/haavard.rue

--

This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.

hrue commented 6 months ago

I do not get why you want to compile your own. there are already precompiled versions for several Linux OS's

inla.binary.install()

yes, it do contain prebuildt libraries. if you want a completely open source version, you have to turn features off.

On Thu, 2024-05-02 at 08:03 -0700, Barry Rowlingson wrote:

You may need to be a bit more aggressive. That won't find versioned shareables eg libXYZ.so.1 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

-- Håvard Rue Professor of Statistics Chair of the Statistics Program CEMSE Division King Abdullah University of Science and Technology Thuwal 23955-6900 Kingdom of Saudi Arabia

@.*** Office: +966 (0)12 808 0640   Mobile: +966 (0)54 470 0421 Research group: bayescomp.kaust.edu.sa   R-INLA project: www.r-inla.org Zoom: kaust.zoom.us/my/haavard.rue

--

This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.

edzer commented 6 months ago

I do not get why you want to compile your own.

I think a lot of people use INLA for important work, and all I know use binary installs. I'm curious about the bus factor of the INLA project, its open source status, and whether I should use or recommend it for future work.

hrue commented 6 months ago

All the R-INLA code is completely open. It's build is too involved for CRAN and it do, by default, depend on external binary only libs (essentially PARDISO). We're working towards replacing the sparse libraries with a new open source one based on tiles (https://icl.utk.edu/projectsfiles/plasma/html/doxygen/), but its a lot of work. the build will then be even more involved, even though all is open source.

We have discussed moving the R-interface on CRAN and require binary installs outside, like JAGS require the jags program to the installed outside R. For this I would need help by someone(s) who know how to handle CRAN

On Fri, 2024-05-03 at 02:26 -0700, Edzer Pebesma wrote:

I do not get why you want to compile your own. I think a lot of people use INLA for important work, and all I know use binary installs. I'm curious about the bus factor of the INLA project, its open source status, and whether I should use or recommend it for future work. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

-- Håvard Rue Professor of Statistics Chair of the Statistics Program CEMSE Division King Abdullah University of Science and Technology Thuwal 23955-6900 Kingdom of Saudi Arabia

@.*** Office: +966 (0)12 808 0640   Mobile: +966 (0)54 470 0421 Research group: bayescomp.kaust.edu.sa   R-INLA project: www.r-inla.org Zoom: kaust.zoom.us/my/haavard.rue

--

This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.

edzer commented 6 months ago

We have discussed moving the R-interface on CRAN and require binary installs outside, like JAGS require the jags program to the installed outside R.

Was this a public discussion, and if not is it public who you refer to by "we"? As a first step, IMO that would require a clean source code repository with clear instructions about how to build and install inla, and for instance a GitHub action that rebuilds it on every commit.

For this I would need help by someone(s) who know how to handle CRAN

Have you reached out to those who did this for jags (Martyn, Dirk)?

finnlindgren commented 6 months ago

We=the people most closely involved in developing and maintaining the package (and related packages).

finnlindgren commented 6 months ago

Getting the cmake build to work would make it possible to activate automated GitHub building and testing, yes. Currently the most extensive multi-platform testing is done when the inlabru GitHub actions are run on GitHub commits there, but that just uses the prebuilt inla package. Haavard runs testing on new builds, but the tests in the tests folder are outdated and need work. The limiting factor in all of this is lack of person-power/time to actually do the work, and most users are unable to help since they are typically not software developers themselves.

edzer commented 6 months ago

In the meantime I managed to compile inla, without pardiso:

/tmp/hr/build64$ local/bin/inla.mkl

    111175339d876568768a24f2b94df2cc7904b2c5 - Wed May 1 21:31:01 2024 +0300

*** Error: Expected argument after options.

Usage: local/bin/inla.mkl [-v] [-V] [-h] [-f] [-eVAR=VALUE] [-tA:B] [-mMODE] FILE.INI

and after quite a few tweeks on things in the tarball @hrue provided above. Is there from your side interest in the tweeks I had to make, and if so how should I provide them?

hrue commented 6 months ago

If you remove pardiso, then you should also remove libiomp5 which is required since the paradiso lib include calls to Intels's openmp libraries, which is then no longer needed, and one avoid potential conflict with libgomp from gcc

I know how the code works and I am able to edit Makefile's if I need to; but thx anyway.

H

On Fri, 2024-05-03 at 12:03 -0700, Edzer Pebesma wrote:

In the meantime I managed to compile inla, without pardiso: /tmp/hr/build64$ local/bin/inla.mkl

111175339d876568768a24f2b94df2cc7904b2c5 - Wed May 1 21:31:01 2024 +0300

*** Error: Expected argument after options.

Usage: local/bin/inla.mkl [-v] [-V] [-h] [-f] [-eVAR=VALUE] [-tA:B] [-mMODE] FILE.INI and after quite a few tweeks on things in the tarball @hrue provided above. Is there from your side interest in the tweeks I had to make, and if so how should I provide them? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

-- Håvard Rue Professor of Statistics Chair of the Statistics Program CEMSE Division King Abdullah University of Science and Technology Thuwal 23955-6900 Kingdom of Saudi Arabia

@.*** Office: +966 (0)12 808 0640   Mobile: +966 (0)54 470 0421 Research group: bayescomp.kaust.edu.sa   R-INLA project: www.r-inla.org Zoom: kaust.zoom.us/my/haavard.rue

--

This message and its contents, including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.

edzer commented 6 months ago

I know how the code works and I am able to edit Makefile's if I need to; but thx anyway.

OK, thanks, so from your side no worries about the open source status and/or bus factor.