Problem when builiding MAGMA with "./tools/codegen.py"

62 views
Skip to first unread message

Danesh Daroui

unread,
Jul 1, 2024, 1:47:21 PM7/1/24
to MAGMA User
Hi all,

I have been able to build MAGMA without any problem by copying MKL ILP64 make file and updaing make.inc file to use Intel's C/C++ and Fortran compilers. Now when I try to build MAGMA on another machine where all prerequisites are available, I always get this error:

./tools/codegen.py -p s include/magma_z.h
make: ./tools/codegen.py: Command not found
make: *** [Makefile.gen.cuda:8847: include/magma_s.h] Error 127

Does anybody know how can I fix the problem?

Regards,

Dan

Mark Gates

unread,
Jul 1, 2024, 2:02:38 PM7/1/24
to Danesh Daroui, MAGMA User
Does ./tools/codegen.py exist? It should, it's in the repo.

Is python installed? Is it available as python or python3? You may need to adjust tools/codegen.py to use python3 instead of python in the first line. Though I would expect a different error in this case:

magma$ ./tools/codegen.py
env: python: No such file or directory

Otherwise, please post your make.inc file and the complete input and output of a `make` run, perhaps compiling one specific file like
    make src/dpotrf.o
It's hard to tell from the abbreviated output what's going on.

Mark

Danesh Daroui

unread,
Jul 1, 2024, 7:51:22 PM7/1/24
to MAGMA User, mga...@icl.utk.edu, MAGMA User, Danesh Daroui
Hi Mark,
Thanks for your response. I cannot find "codegen.py" in the "tools" directory. I download MAGMA as zipped file and then extract it. I can post my make.inc file but first I think that I need to resolve the issue with "codegen.py" file. I even cannot find "codegen.py" in the directory that I am able to build MAGMA successfully. My guess is that, this file is generated on-the-fly but not included in the source code.
Regards,
Dan

Mark Gates

unread,
Jul 1, 2024, 9:19:57 PM7/1/24
to Danesh Daroui, MAGMA User
Ah, sorry, codegen.py is removed when making the tar file, the assumption being that all the files have been generated when making the tar file, so it isn't needed after that. If you check MAGMA out from the Git repo, it would be there.

Did you update magma_z.h or change or remove any files in the include directory? Normally, in a release, the [sdc] versions of files should be newer than the [z] version from which they are generated:

magma-2.8.0> ls -l include/magma_[sdcz].h
-rw-r--r-- 1 mgates users 58122 Mar 28 12:27 include/magma_c.h
-rw-r--r-- 1 mgates users 53785 Mar 28 12:27 include/magma_d.h
-rw-r--r-- 1 mgates users 53090 Mar 28 12:27 include/magma_s.h
-rw-r--r-- 1 mgates users 58772 Mar 28 12:22 include/magma_z.h

Mark

Mark Gates

unread,
Jul 2, 2024, 12:59:11 PM7/2/24
to Danesh Daroui, MAGMA User
It appears that the Makefile thinks magma_s.h is out-of-date with respect to magma_z.h. If the timestamps aren't modified, I don't know why `make` would think it needs to update the files.

The easiest solution is to get codegen.py and magmasubs.py from the Git repo.
You may need to make codegen.py executable and change python to python3, depending on your platform.

I'm not sure why they were removed from the release. We will put them back into future releases to avoid this kind of issue.

Mark

Danesh Daroui

unread,
Jul 3, 2024, 12:22:40 PM7/3/24
to MAGMA User, mga...@icl.utk.edu, MAGMA User, Danesh Daroui
I copied these two Python files and the code is now built without any problem.

Thanks
Reply all
Reply to author
Forward
0 new messages