Forum OpenACS Q&A: Compiling Aolserver on x86_64

Collapse
Posted by Michael Steigman on
I'm setting up a new Athlon 64 system and have run into compilation issues with Aolserver 4.0.10. I've done a little bit of searching dug up a few Aolserver chat sessions mentioning compilation issues on x86 64 bit systems and some small changes necessary to make things work but I couldn't find the actually changes.

Here is where compilation fails for me:

conn.c: In function âNsTclConnObjCmdâ:
conn.c:843: error: invalid lvalue in assignment

Does anyone have a list of the changes necessary to get Aolserver running on the new Athlons?

Collapse
Posted by Dave Bauer on
I have the same problem compiling AOLserver 4.0.10 on a 32 bit system.

At least I think it is :)

Anyway, I compiled Tcl 8.4.11 on this system as well. Its FC4 2.6.12 kernel compiled fir i686, in this case. If fact its cvs.openacs.org and I can't install the cvs browser until I get it fixed.

Collapse
Posted by Michael Steigman on
Interesting. Based on what I found when searching, I knew there were issues on x86_64 so I assumed this was one of them. I hadn't even thought of the possibility it was TCL (I've probably built 4.0.10 a half-dozen times with different versions of TCL) but I compiled/installed TCL 8.4.11 as well. Seems like this might be a problem with the latest version of TCL.

My original question still applies, though :)

Collapse
Posted by Vinod Kurup on

This may be due to a change in gcc version 4, according to this thread.

So, applying this diff to nsd/conn.c seems to work:

--- nsd/conn.c~ 2003-08-05 15:56:05.000000000 -0400
+++ nsd/conn.c  2005-08-01 12:08:38.000000000 -0400
@@ -840,7 +840,7 @@
     }

     result  = Tcl_GetObjResult(interp);
-    connPtr = (Conn *) conn = itPtr->conn;
+    connPtr = conn = (Conn *) itPtr->conn;

     /*
      * Only the "isconnected" option operates without a conn.
Collapse
Posted by Michael Steigman on
Ah... so it was neither TCL nor Aolserver!

That change got me to a different error:

gcc -pipe -L../nsthread -L../nsd -o nsd main.o libnsd.so -lnsthread -L/usr/local/lib -ltcl8.4 -ldl -lpthread -lieee -lm -lz -lgcc_s -Wl,--export-dynamic -Wl,-rpath,/home/aolserver/lib -Wl,-rpath,/usr/local/lib
libnsd.so: undefined reference to `pthread_kill_other_threads_np'
collect2: ld returned 1 exit status
make[1]: *** [nsd] Error 1
make[1]: Leaving directory `/home/src/aolserver-4.0.10/nsd'
make: *** [all] Error 1

Still compiling against 8.4.11. I downloaded 8.4.10, which would not compile and 8.4.9 which did compile, though I didn't install it.

Collapse
Posted by Dave Bauer on
Same error for me after applying the patch.

This is my GCC

[daveb@george aolserver-4.0.10]$ gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib
--enable-__cxa_atexit --disable-libunwind-exceptions
--enable-libgcj-multifile
--enable-languages=c,c++,objc,java,f95,ada
--enable-java-awt=gtk
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--host=i386-redhat-linux

Thread model: posix gcc version 4.0.0 20050519 (Red Hat 4.0.0-8)

Collapse
Posted by Dave Bauer on
That is, I get the same error as Michael about pthread.
Collapse
Posted by Dave Bauer on
Collapse
Posted by Dave Bauer on
Try this http://www.opensubscriber.com/message/aolserver@listserv.aol.com/1619884.html

"his was my fault, being overzealous in the very broad #ifdef check.
Really need to test for LinuxThreads and use #ifdef HAVE_LINUXTHREADS.
Newer Linux has NPTL and not LinuxThreads.

You can just comment out the pthread_kill_other_threads_np() line and
you should be fine.

To check whether your system is using LinuxThreads or NPTL, you can try
this:

$ getconf GNU_LIBPTHREAD_VERSION
NPTL 0.60

That's from my system, running Debian with a custom 2.6.10 kernel and
libc6 2.3.2, here. "

Collapse
Posted by Dave Bauer on
in nsd/unix.c
comment out line 74

/* pthread_kill_other_threads_np(); */

and I compiled sucessfully.

Collapse
Posted by Vinod Kurup on
And mine shows:
vinod@vkurup:~/temp/aolserver-4.0.10$ getconf GNU_LIBPTHREAD_VERSION
linuxthreads-0.10
which explains why I didn't get that pthreads error.
Collapse
Posted by Michael Steigman on
OK, that did the trick. I was able to compile. Then I ran into the 64-bit problem - Aolserver would not start up. I went back through the aolserver chat logs and was able to find the following:

IRC [11:45] <Dossy> one liner
IRC [11:45] <Dossy> /*
IRC [11:45] &lt;Dossy&gt; if (sizeof(int) < sizeof(long)) {
IRC [11:45] &lt;Dossy&gt; Tcl_Panic("NsTclInitObjs: sizeof(int) < sizeof(long)");
IRC [11:45] &lt;Dossy&gt; }
IRC [11:45] &lt;Dossy&gt; */
IRC [11:45] &lt;Dossy&gt; there.
IRC [11:45] &lt;Dossy&gt; sorry, 3 lines - comment 'em out
IRC [11:45] &lt;Dossy&gt; in nsd/tclobj.c
IRC [11:45] &lt;Dossy&gt; on LP64, sizeof(int) != sizeof(long)
IRC [11:46] &lt;Dossy&gt; but that's "okay" as long as your code is 64-bit clean, which I *believe* tcl and stock AOLserver is
IRC [11:46] &lt;Dossy&gt; add-on modules may NOT be - BEWARE.

After making that change, I was able to compile and am now up and running. I think 4.0.11, when released, will work without the patch.

Thanks, guys.

Collapse
Posted by Mohammad Al-Ghazali on
I got some error over here,I don't know wether i successfully install it or not,can someone plese tell me if my installation is not successfull

conn.c: In function ‘NsTclConnObjCmd’:
conn.c:843: error: invalid lvalue in assignment
gmake[1]: *** [conn.o] Error 1
gmake[1]: Leaving directory `/usr/local/src/aolserver40r10/aolserver/nsd'
gmake: *** [all] Error 1

i'm using gmake install instead of make install and if I use make install the error would also be the same as above

Collapse
Posted by Mohammad Al-Ghazali on
After reading back all the thread i found out that my gcc is version 4,so can anybody tel me,how do i apply the patch into the file,what should be added and what shouldn't
Collapse
Posted by jester jaimi on
I know this is old news, but I have a new client who has me doing CMS evaluations, and I would like to set up a dotlrn instance, but I can't get AOL Server to build on Fedora Core 4. The configure output seems rational, but it bombs on make install. The compiler is GCC 4.0.2. I read this thread, but I couldn't parse a similar error. Perhaps I'm blind. Anyway, dotlrn looks awesome, but if it takes lots of black magic to install and maintain all of the underlying components, I may just have to write it off and move on to something that installs cleanly.

Here is the error I am getting.

Any help on this would be greatly appreciated.

~jj

[root@localhost aolserver-4.5.0]# gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --host=i386-redhat-linux
Thread model: posix
gcc version 4.0.2 20051125 (Red Hat 4.0.2-8)
[root@localhost aolserver-4.5.0]# make install
./util/nsmakeall.tcl install nsthread nsd nstclsh
./util/nsmakeall.tcl: line 48: syntax error near unexpected token `}'
./util/nsmakeall.tcl: line 48: `}'
make: *** [install-bins] Error 2

Collapse
Posted by Malte Sussdorff on
Hi Jester, maybe following the steps described in http://cognovis.de/developer/en/aolserver_install will get you rolling. Note that the configuration of AOLserver has changed from previous versions.
Collapse
Posted by jester jaimi on
Malte,

Looking at your site, it's safe to assume that dotlrn is compatible with AOLServer 4.5, no?

I was digging around, but I couldn't find the english version of your companies web content, only the developer stuff.

If there is any "en" literature that you point me to to learn more about cognovis, that would be greatly appreciated.

Danke!

~jj

Collapse
Posted by jester jaimi on
I keep getting kicked out of aolservers anonomyous cvs...

[root@jester aolserver45]# cvs -z3 -d:pserver:mailto:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co -r aolserver_v45_bp aolserver
cvs [checkout aborted]: connect to aolserver.cvs.sourceforge.net(66.35.250.91):2401 failed: Connection refused

Anyone out there possibly know why this is happening?

~jj