Install AFNI old version.

Hello,
I'm hpc cluster admin. One of our users requests to install AFNI older version.
Now, the latest version is 24.3.06. But, the user wants 18.1.05 and 23.3.07
How can I install the older version of AFNI? Is it possible with executing @update.afni.binaries?
Any answer might be helpful for me.
Thank you in advance.

Sangmin

You can use build_afni.py to build any git version like this:

build_afni.py -build_root my/build/dir          \
                      -git_branch master -git_tag AFNI_18.1.05  \
                      -package linux_centos_7_64

Change the package type to the one you use there.

Thank you for your help, dglen.

I downloaded AFNI 23.3.07 version because ver 18.1.05 does not include 'build_afni.py'. I think it's not matter.
After that, I went to scripts directory. I ran build_afni.py code and got this.

~/afni-AFNI_23.3.07/src/python_scripts/scripts $ ./build_afni.py
Traceback (most recent call last):
  File "./build_afni.py", line 11, in <module>
    from afnipy import option_list as OL
ModuleNotFoundError: No module named 'afnipy'

I think it's matter of dependency. For going forward, do I need to create conda env and install that package in it?

Sangmin

Hi, Sangmin-

I think the assumption was that you already had a working+installed AFNI, and hence you could run the command @dglen provided. The 'afnipy' module will be in your download, just not in the place needed in the distributed code.

So, do you already have a relatively current/modern AFNI installed? And what OS are you using?

--pt

Hello, ptaylor

Yes, I already installed the latest AFNI with @update.afni.binaries file. I ran that file with 'tcsh' command and installed it in to specific directory that is not in my home directory.

I use Rocky Linux 8.

I have no idea whith 'build_afni.py'

--Sangmin

Hi, Sangmin-

OK, so if you have installed a current version of AFNI on your computer, including adding it to your path, then does running:

which build_afni.py

... output the path to that location where the AFNI binaries have been installed?

If so, you can just run the build_afni.py program like you would run any program, because it should be in your path as part of your AFNI installation.

So then you could run, say, this (NB: PT updated the codeblock here to have the correct package name, fixing a misspelling that was pointed out by @Sangmin in a subsequent post):

build_afni.py                                                                \
    -abin        ${HOME}/ABIN_ver_18.1.05                                    \
    -build_root  ${HOME}/BUILD_ver_18.1.05                                   \
    -git_branch  master                                                      \
    -git_tag     AFNI_18.1.05                                                \
    -package     linux_rocky_8

and that should install the binaries with AFNI version 18.1.05 into ~/ABIN_ver_18.1.05 (and you could certainly change that location+name).

Does that work?

--pt

Hello, ptaylor
It works perfectly with AFNI 23.3.07, but need to modify type linux_rock_8 to linux_rocky_8. Here is the log.

sangmin@n001 ~ $ build_afni.py -abin /applics/afni/23.3.07/abin -build_root /applics/afni/23.3.07/build -git_branch master -git_tag AFNI_23.3.07 -package linux_rocky_8

-- build_afni.py, version 0.13, September 12, 2024
-- current AFNI: AFNI_24.3.06, linux_rocky_8, Oct 31 2024
-- cleaning old build root dir, /applics/afni/23.3.07/build
-- backing up dir build_src
-- preparing build_root dir, /applics/afni/23.3.07/build
-- checking out git tag AFNI_23.3.07
-- using repo branch (detached), tag AFNI_23.3.07
-- removing old atlas dir, prev/afni_atlases_dist
-- moving old atlas dir afni_atlases_dist to prev/afni_atlases_dist
-- downloading AFNI atlas package, afni_atlases_dist.tgz
-- unpacking atlas package, afni_atlases_dist
-- removing old NiiVue backup, prev/niivue_afni.umd.js
-- moving old niivue niivue_afni.umd.js to prev/niivue_afni.umd.js
-- downloading NiiVue, niivue_afni.umd.js

-- preparing to run 'make' build of package linux_rocky_8
-- copying README files
-- copying Makefile.linux_rocky_8 to Makefile
-- building make target 'itall'

-- consider monitoring the build in a separate window with:
       cd /network/iss/home/sangmin.park
       tail -f /applics/afni/23.3.07/build/build_src/log_make.txt
       # use ctrl-c to terminate 'tail' command (not the build)
++ building (please be patient)...
-- status: building SUCCESS
   see 'make' log file /applics/afni/23.3.07/build/build_src/log_make.txt
-- make build AFNI: AFNI_23.3.07, linux_rocky_8, Dec 05 2024
++ testing the build results ...
-- status: build testing SUCCESS
   see 'testing' log file /applics/afni/23.3.07/build/build_src/log_test.txt

-- will install 'make' build results and atlases

       PLEASE WAIT FOR THE INSTALL TO COMPLETE...

++ creating install abin: /applics/afni/23.3.07/abin
-- skipping abin backup
++ installing atlases under /applics/afni/23.3.07/abin
++ installing build results under /applics/afni/23.3.07/abin
++ installing NiiVue under /applics/afni/23.3.07/abin

-- shell/system command history is in:
      /applics/afni/23.3.07/build/hist_commands.txt

++ screen text history is in:
      /applics/afni/23.3.07/build/hist_messages.txt


============================== overview ==============================

------------------------------
to rerun make build:
   cd /applics/afni/23.3.07/build/build_src
   make itall
------------------------------
to rerun test of make build:
   cd /applics/afni/23.3.07/build/build_src
   tcsh scripts_install/test_afni_prog_help.tcsh -bin_dir linux_rocky_8
------------------------------
atlases installed to   /applics/afni/23.3.07/abin
        installed from /applics/afni/23.3.07/build/afni_atlases_dist
------------------------------
binaries installed to   /applics/afni/23.3.07/abin
         installed from /applics/afni/23.3.07/build/build_src/linux_rocky_8
------------------------------
NiiVue installed to /applics/afni/23.3.07/abin
------------------------------
have 0 backup abin directories, backup.abin.*
have 0 backup abin directories, backup.abin.*

But, whenI try to install version 18.1.5, I got this error. AFNI 18.1.05 might not have linux_rocky_8 package.

sangmin@n001 ~ $ build_afni.py \
        -abin /applics/scit/afni/18.1.05/abin \
        -build_root /applics/afni/18.1.05/build \
        -git_branch master \
        -git_tag AFNI_18.1.05 \
        -package linux_rocky_8

-- build_afni.py, version 0.13, September 12, 2024
-- current AFNI: AFNI_24.3.06, linux_rocky_8, Oct 31 2024
-- preparing build_root dir, /applics/afni/18.1.05/build
-- creating build_root dir, /applics/afni/18.1.05/build
-- running 'git clone' on afni repo ...
   (please be patient)
-- checking out git tag AFNI_18.1.05
-- using repo branch (detached), tag AFNI_18.1.05
-- downloading AFNI atlas package, afni_atlases_dist.tgz
-- unpacking atlas package, afni_atlases_dist
-- downloading NiiVue, niivue_afni.umd.js

-- preparing to run 'make' build of package linux_rocky_8
-- copying README files
** error: failed to find suitable Makefile for package linux_rocky_8

-- shell/system command history is in:
      /applics/afni/18.1.05/build/hist_commands.txt

++ screen text history is in:
      /applics/afni/18.1.05/build/hist_messages.txt

Is it possible to check which packages are available along with AFNI version?

--Sangmin

Hi, Sangmin-

Thanks for mentioning the spelling mistake (I have fixed the post code above, noting the change, to help any future users).

For version=18.1.5, I see what the problem is: Linux Rocky 8 didn't exist back in 2018, so we didn't have a Makefile for it then! (The major number in an AFNI version denotes the year).

So, if you really need such old code, I guess you might have to run a different makefile then. I am not sure if using the openmp_64 makefile, which has been pretty general on different systems, would be useful? I am guessing the use case involves an old-new comparison of code, and compilation differences would get rolled into the comparison as well. I will defer to @rickr about what might be best to do here.

--pt

Hello, ptaylor

I already downloaded precompiled version of linux_openmp_64.tgz and untar it.
User said it works well on our Rocky Linux 8.

Thank you for your help. I really appreciate it.

Best regards,
Sangmin

Hi, Sangmin-

Ah, and that is of the specific ver=18.1.05? OK, great, glad that worked.

--pt

1 Like

Hello, ptaylor

Yes, its version is 18.1.05. It's good for us.
Thanks a lot.

--Sangmin

1 Like

Yes, that is why we keep the old linux_openmp_64.tgz package around, it can be used on many systems.
Note that to build a version that predates rocky_8 (for example), you could possibly pass the current Makefile via build_afni.py -makefile my.fave.makefile. This is not sure to work though, since updates to the current Makefile might still not work on an older system... Though you might even be able to just tell is to build the linux_openmp_64 package. Maybe it would work, maybe not.

Anyway, it's good to know that you have a package that works.

-rick