[tlbuild] Oracle Solaris 11.3 x86 and asymptote: success!

Nelson H. F. Beebe beebe at math.utah.edu
Fri May 6 18:41:14 CEST 2016


Yesterday, we got an old physical machine (Sun Ultra 24) running with
a fresh install of Oracle Solaris 11.3, the latest available version
of that O/S.  The latest executables in /bin are dated 20-Apr-2016,
only 16 days ago.

I then populated the system with scores of packages from the
third-party CSW repository that go into the /opt/csw tree, so we can
choose to use them, or ignore them.

This morning, I got a successful 32-bit build of the texlive-20160504
snapshot using the Oracle-supplied gcc 4.8.2 compilers in /bin,
producing 403 executables that are now available in the binary
distributions under

	http://www.math.utah.edu/pub/texlive/

Next, I attempted to build asympote with those compilers, but got a
build failure.  I did a "make distclean" in the asympote directory and
restarted with CC and CXX pointing to the 4.9.2 compilers in the
/opt/csw/bin tree, and that too failed.  I repeated the experiment,
this time with the 5.2.0 compilers from that tree, and finally got a
successful build.

A substantial part of asympote is written in C++, and that language is
almost always a barrier to software portability, with ISO Standards
from 1998, 2003, 2011, and 2014, and C++ compilers on various Unix
systems at various subsets of those Standards.

Here are the errors that I see:

CXX=/bin/g++

	g++ -Wall -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -DUSEGC \
	    -D_REENTRANT -pthreads -DFFTWPP_SINGLE_THREAD -g -O2 -g -O3 \
	    -ansi -fno-var-tracking   -I. -Igc-7.4.2/include -o runpath.o -c runpath.cc
	runtime.in: In function 'void run::gen_runtime3(vm::stack*)':
	runtime.in:244:22: error: 'isnan' is not a member of 'std'
	 {
			      ^
	runtime.in:244:22: note: suggested alternative:
	In file included from /usr/gcc/4.8/include/c++/4.8.2/cmath:44:0,
			 from pair.h:18,
			 from settings.h:15,
			 from errormsg.h:13,
			 from stack.h:13,
			 from runtimebase.in:1:
	/usr/include/math.h:206:12: note:   'isnan'
	 extern int isnan __P((double));
		    ^
	runarray.in: In function 'void run::gen_runarray66(vm::stack*)':
	runarray.in:1775:15: warning: unused variable 'a' [-Wunused-variable]
	   array *c=new array(n);
		       ^
	gmake: *** [runtime.o] Error 1

CXX=/opt/csw/bin/g++-4.9

	Undefined                       first referenced
	 symbol                             in file
	std::__throw_out_of_range_fmt(char const*, ...) drawlabel.o
	ld: fatal: symbol referencing errors
	collect2: error: ld returned 1 exit status
	Makefile:109: recipe for target 'asy' failed

CXX=/opt/csw/bin/g++-5.2

	Success, but needed several CSW packages to complete the
	build:
	
	%  ldd asy | grep /opt | sort
		libGL.so.1 =>		/opt/csw/lib/libGL.so.1
		libGLU.so.1 =>		/opt/csw/lib/libGLU.so.1
		libOSMesa.so.7 =>	/opt/csw/lib/libOSMesa.so.7
		libgcc_s.so.1 =>	/opt/csw/lib/libgcc_s.so.1
		libglut.so.3 =>		/opt/csw/lib/libglut.so.3
		libncurses.so.5 =>	/opt/csw/lib/libncurses.so.5
		libreadline.so.5 =>	/opt/csw/lib/libreadline.so.5
		libsigsegv.so.0 =>	/opt/csw/lib/libsigsegv.so.0
		libstdc++.so.6 =>	/opt/csw/lib/libstdc++.so.6
		libz.so.1 =>		/opt/csw/lib/libz.so.1

For the last build, I configured and built asympote like this:

	PATH=/usr/uumath/texlive/2016/bin/i386-solaris-11:/opt/csw/bin:/bin
	export PATH
	env							\
		CC=/opt/csw/bin/gcc-5.2				\
		CXX='/opt/csw/bin/g++-5.2 -I/opt/csw/include'	\
		LDFLAGS='-R/opt/csw/lib -L/opt/csw/lib'		\
		./configure					\
			--prefix=/tmp/asyinst			\
			--enable-texlive-build			\
			--disable-gsl				\ 
			--disable-fftw
	gmake all check

I found it necessary to have /opt/csw/bin ahead of /bin, because the
latter has older versions of gs and texi2dvi that break the asympote
build.

I then wondered whether more of those /opt/csw packages could be
eliminated by a change in LDFLAGS, adding system directories
ahead of CSW ones.  This setting

	LDFLAGS=-R/lib -L/lib			\
		-R/usr/lib -L/usr/lib		\
		-R/opt/csw/lib -L/opt/csw/lib	\
		-static-libstdc++' 

led to a new asy executable with only these unwanted references:

	% ldd asy | grep /opt | sort
		libGL.so.1 =>    /opt/csw/lib/i386/libGL.so.1
		libglut.so.3 =>  /opt/csw/lib/libglut.so.3

Notice the addition of the -static-libstdc++ flag, a g++ flag that I
only recently discovered.  A test with our many historical versions of
gcc builds shows that that flag is recognized with gcc-4.5 and later.
That flag eliminates references to libstdc++.so in the executables;
that library's location is inside the gcc compiler installation tree,
and tends to be unique to each version of gcc, and thus, undesirably
ties executables to the filesystem in which the compiler is installed.

I made a final build of asymptote as in the last example, but adding
--disable-gl to the configure command line.  That produces an asy
executable with ZERO references to the /opt/csw tree.

I've included all three asy executables in the our TeX Live 2016
installation for Solaris 11.3, and in the binary distribution files at
the Web site noted at the start of this long message:

% cd /usr/uumath/texlive/2016/bin/i386-solaris-11
% ls -liog asy* | sort
   1592935 -rwxrwxr-x   1 15022920 May  6 10:02 asy-with-less-csw
   1676435 -rwxrwxr-x   1  7464536 May  6 09:17 asy-with-more-csw
   1679985 -rwxrwxr-x   2 14838636 May  6 10:28 asy
   1679985 -rwxrwxr-x   2 14838636 May  6 10:28 asy-with-no-csw

I now have to do a fresh build of TeX Live 2016 with xindy enabled,
because /bin/clisp exists on Solaris 11, and is the latest available
version, 2.49.

I also plan to try a 64-bit build of TeX Live 2016 on that system.

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe at math.utah.edu  -
- 155 S 1400 E RM 233                       beebe at acm.org  beebe at computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------


More information about the tlbuild mailing list