Welcome to iraf.net Wednesday, May 01 2024 @ 10:29 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Success on compiling external packages on x86 64bit machines
   
westra
 02/14/2007 05:52AM (Read 3876 times)  
+----
Newbie

Status: offline


Registered: 03/13/2006
Posts: 9
I have been struggling with this for ages, but I would really give my experience to other people what I found out to get some external packages running on a Fedora Core 6 machine, which is 64bit. For this, I downloaded the standard Redhat binaries (note, 32bit!) from iraf.net. When you want to compile the package that has *no* Redhat binaries for it, you can create them by making the following changes. They are quite general. I've tried them for ifocas and local (the local packages we run here). The recipe is the same for all (read below for pkg the package directory name, or the package name, whatever is appropriate):Add in pkg/lib/mkpkg.inc to every *FLAGS line the following: -m32, so it should look like:
[code:1:71c3fef16b]$set XFLAGS = "$(XFLAGS) -p ifocas -m32"
$set XVFLAGS = "$(XVFLAGS) -p ifocas -m32"
$set LFLAGS = "$(LFLAGS) -p ifocas -m32"
[/code:1:71c3fef16b]
(Ifocas is the used package in this example, but you catch my drift.)Then in both pkg/src/mkpkg and pkg/mkpkg you add -m32 to each line starting with $link, i.e.:
[code:1:71c3fef16b]$link x_focas.o libpkg.a -lc -o xx_focas.e -m32
[/code:1:71c3fef16b]
(so, that's two files to be changed!!)Finally, if it does not exist, create pkg/bin.redhatFix up the $hlib/external.pkg as usual...Then as iraf user go into cl and type:
cd pkg$
mkpkg -p pkgAnd it should compile.If you have a normal makefile, i.e. you need to type something like make or make ALL, just add -m32 to all *FLAGS and it should compile.Hope this helps all desperate people out there with 64bit machines. Make sure, of course, that you have always the 32bit libraries installed of everything Wink(fitz: if you think this is useful, you could make this a sticky...)

 
Profile Email
 Quote
fitz
 02/14/2007 05:52AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi Eduard,Sorry I overlooked this post, but thanks for putting it up just the same! In general, compile-time flags can be added to the hlib$mkpkg.inc file rather than the individual package mkpkg files since this is read internally during all builds. Adding the '-m32' flag to this file will affect all packages being compiled, likewise there are environment variables (e.g. XC_LFLAGS) that can be defined to control aspects of the compilation at the user level.We say "64-bit-OS compiles aren't supported" not because these options aren't available, but because they require the host OS to have installed the 32-bit compatabiltity libs (which vary in support by OS), and even if they are intstalled it is distro-dependent as to whether these libs are compatible with legacy systems like IRAF. FC6+32-bit-compat seems to work for you, but in past experience the simple addition of a '-m32' flag didn't so easily fix all the problems we've seen and doesn't appear to be a magic solution.Your post is good news (I wasn't watching when FC6 was released) but doesn 't entirely fix the problem. Host systsems that use 64-bit filesystems or >2GB of memory may have additional problems with 32-bit binaries whether compiled locally or from the pre-built packages. I hope the trend is for 32-bit compatible systems being much better supported in the newer linux distros, but 64-bit support is still required in the core IRAF system.-Mike

 
Profile Email
 Quote
westra
 02/14/2007 05:52AM  
+----
Newbie

Status: offline


Registered: 03/13/2006
Posts: 9
Hi Mike,[quote:88fc8ff6d6="fitz"]Sorry I overlooked this post, but thanks for putting it up just the same! In general, compile-time flags can be added to the hlib$mkpkg.inc file rather than the individual package mkpkg files since this is read internally during all builds. Adding the '-m32' flag to this file will affect all packages being compiled, likewise there are environment variables (e.g. XC_LFLAGS) that can be defined to control aspects of the compilation at the user level.[/quote:88fc8ff6d6]
Not a problem...The solution you say indeed to change the 'global' *FLAGS is now something I found out as well and I have implemented that.[quote:88fc8ff6d6="fitz"]We say "64-bit-OS compiles aren't supported" not because these options aren't available, but because they require the host OS to have installed the 32-bit compatabiltity libs (which vary in support by OS), and even if they are intstalled it is distro-dependent as to whether these libs are compatible with legacy systems like IRAF. FC6+32-bit-compat seems to work for you, but in past experience the simple addition of a '-m32' flag didn't so easily fix all the problems we've seen and doesn't appear to be a magic solution.[/quote:88fc8ff6d6]
The reason why it does work on FC6 (I won't guarantee any other platform) is the fact that the prebuilt-binaries are for a Redhat/FC system. There are still differences between RH9 and FC6, but most are solvable.[quote:88fc8ff6d6="fitz"]Your post is good news (I wasn't watching when FC6 was released) but doesn 't entirely fix the problem. Host systsems that use 64-bit filesystems or >2GB of memory may have additional problems with 32-bit binaries whether compiled locally or from the pre-built packages. I hope the trend is for 32-bit compatible systems being much better supported in the newer linux distros, but 64-bit support is still required in the core IRAF system.-Mike[/quote:88fc8ff6d6]
I'm glad to hear that it is useful. A great dream would be a 64bit IRAF, but I think that is a bit too much to ask. Today I've been trying to get ximtool to build on the same setup. I had a lot of trouble getting there. The original binaries provided by iraf.net gave a GLIBC_2.0 error. Solutions with adding older FC4 library files and LD_LIBRARY_PATH did *not* resolve this. So, after a *lot* (really a lot) of fiddling (and not many patches), I've been able to get a running(!!) version of ximtool and xgterm natively built on the machine as 32bits binaries. The solution:Download https://iraf.net/ftp/iraf/x11iraf/x11iraf-v1.5DEV-src.tar.gz
(I untarred in /iraf/iraf/Downloads/x1115, so replace every instance below with your location)
Then patch the following files in x1115/:Patch xgterm/charproc.c add the #ifdef and #endif statements around the two
lines below (lines 1647 and 1648)
[code:1:88fc8ff6d6]#ifdef ALLOWLOGGING
if (bcnt > 0 && screen->logging)
write (screen->logfd, buffer, bcnt);
#endif[/code:1:88fc8ff6d6]Patch obm/ObmW/Xraw/TableP.h to ignore table.h, i.e. /* */ around the include
line for table.h (notice small t!)Patch xgterm/button.c char *malloc -> void *mallocPatch $hlib/mkpkg.inc to have:
[code:1:88fc8ff6d6]$else $ifeq (MACH, redhat) then
$set XFLAGS = "-c -w -m32 -I/iraf/iraf/unix/bin.redhat/" # default XC compile flags
$set XVFLAGS = "-c -w -m32 -I/iraf/iraf/unix/bin.redhat/" # VOPS XC compile flags
$set LFLAGS = "-Nz -m32" # default XC link flags[/code:1:88fc8ff6d6]
(which is the solution which Mike contributed above, plus a solution to get rid of an f2c.h dependency error)Then the magic comes:First type:
[code:1:88fc8ff6d6]xmkmf[/code:1:88fc8ff6d6]
Then [code:1:88fc8ff6d6]make clean[/code:1:88fc8ff6d6] (just in case)
And the "short" line(notice that it is really 1 (one) line!!!):[code:1:88fc8ff6d6]make CFLAGS='-DUSE_STDARG=1 -I/iraf/iraf/Downloads/x1115/obm/Tcl -I/iraf/iraf/Downloads/x1115/xpm/ -L/iraf/iraf/Downloads/x1115/obm/ -I/iraf/iraf/Downloads/x1115/include/' DEPENDFLAGS='-DUSE_STDARG=1 -I/iraf/iraf/Downloads/x1115/obm/Tcl -I/iraf/iraf/Downloads/x1115/xpm/ -I/iraf/iraf/Downloads/x1115/include/' IMAKE_DEFINES='-U__amd64__ -U__x86_64__' CC='gcc -m32 -O' World >& spool[/code:1:88fc8ff6d6]Replace /iraf/iraf/Downloads/x1115 with wherever this was untarred... gcc4 (and even gcc34) doesn't allow varargs anymore. To fix that, I set USE_STDARG for both CFLAGS and DEPENDFLAGS. Then the -I's are to resolve remaining include problems. To make sure we get 32bit (64 is not possible, since intricate linking with IRAF, which we have pre-built on 32bit), I added the CC to have the 32 bit option in it. Also an optimiser flag in there as well.The only thing that needs to be done then is to create the /dev/imt* pipes. A colleague of mine did this, so I can't get you the command, but I know for sure that it is somewhere in a manual.

 
Profile Email
 Quote
   
Content generated in: 0.08 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login