
ASYMPTOTE: The build process for TeX Live does not automatically build
asymptote. Asymptote must be built separately.
This requires first building four libraries, fftw-3.3.6, gsl-1.16, readline-6.3, 
glew. We carefully build these so they will statically link, because they may not
exist on user machines.

As usual, we put this preparation step at the end and describe here the steps
to rebuild asymptote if there are changes.

	cd
	cd texlive2019dev
	rsync -a --delete --exclude=.svn tug.org::tldevsrc/Build/source .

	1) add two curl files

	2) add glm folder to asymptote source

	3) edit glrender.cc:1266 by commenting out line with GLUT_CORE_PROFILE

	4) edit Make file by removing -lgccpp (after .configure)



BUILDING ASYMPTOTE:

On older systems, disable /usr/local.  On Sierra, disable the bin, include, lib, share, and texlive folders in /usr/local. For example

	cd /usr
	sudo mv local local-temp


If the sources were updated, two libraries may will be missing. These must be obtained, and the configure script suggests
wget. Here are replacements using curl.

	cd
	cd ~/texlive2019dev/source/utils/asymptote
	curl -O http://hboehm.info/gc/gc_source/gc-7.6.0.tar.gz
	curl -O http://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-7.6.10.tar.gz

Now build asymptote. 



	cd
	cd ~/texlive2019dev/source/utils/asymptote
	make clean
		(reach into texlive2019dev/source/utils/asymptote
		 and throw away the folder gc-7.4.2, keeping gc-7.4.2open.tar.gz)
	export CPPFLAGS="-I/Users/koch/AsymptoteBuild/include -I/Users/koch/AsymptoteBuild/include/gsi -I/Users/koch/AsymptoteBuild/include/readline -I/Users/koch/AsymptoteBuild/include/OpenGL"
	export LDFLAGS="-L/Users/koch/AsymptoteBuild/lib" 
	./configure --prefix=/tmp/asyinst --enable-texlive-build --enable-gc=7.6.0
	make # CFLAGS="-g -DBROKEN_COMPILER"
	strip asy


--enable-gc=7.6.0


	## To test, 

	cd
	cd ~/texlive2019dev/source/utils/asymptote
	make check

	## We want Testing errors…PASSED

	## End of checking
 

Move To Desktop 
	
	cd 
	cd texlive2019dev/source/utils/asymptote
	cp asy ~/Desktop/asy
	
Fix Local When Done


	cd /usr/local
	rm bin, lib, share, include
	rename bin, lib, share, include, and texlive


----------------

NOTES: gsl-2.5 is latest, released June 14, 2018

	fftw 3.3.8 is the latest, released May 28, 2018


This as of Feb 26, 2019





INITIAL STEPS; DO THESE JUST ONCE BEFORE BEGINNING
TO BUILD ASYMPTOTE:

You must compile three libraries, which will be statically linked so that in
the end they are not installed in a user's system. 

Create a folder named "AsymptoteBuild" in your home directory.

Get the Fast Fourier Transform Library (FFTW) from http://www.fftw.org/
and install the tar.gz file in AsymptoteBuild. Decompress it, producing a folder
named fftw-3.3.8. 

Get the GNU Scientific Library (GSL) from http://www.gnu.org/software/gsl/
and install the tar.gz file in AsymptoteBuild. Decompress it, producing a folder
named gsl-2.5. 

Get the GNU Readline Library from https://tiswww.case.edu/php/chet/readline/rltop.html 
and install the tar.gz file in AsymptoteBuild. We use version 6.3, which has always 
worked, rather than version 7.0. Decompress it, producing a folder 
named readline-6.3 containing the source code.

Get the GLEW Library from http://glew.sourceforge.net. The latest version is 2.1.0.
Install the folder glew-2.1.0 in the AsymptoteBuild folder.

Build these libraries as follows:

	cd ~/AsymptoteBuild
	cd fftw-3.3.8
	make clean
	./configure --prefix=/Users/koch/AsymptoteBuild --exec-prefix=/Users/koch/AsymptoteBuild
	make
	make install

	cd ..
	cd gsl-2.5
	make clean
	./configure --prefix=/Users/koch/AsymptoteBuild --exec-prefix=/Users/koch/AsymptoteBuild
	make
	make install

	cd ..
	cd readline-6.3
	make clean
	./configure --prefix=/Users/koch/AsymptoteBuild --exec-prefix=/Users/koch/AsymptoteBuild
	make
	make install

	cd /Users/koch/AsymptoteBuild/lib
	rm -f *.dylib
	rm -f *.la

Unfortunately, the glew library does not come with a configure script. Instead, a make file has
already been created, and this file installs into /usr/local. So rename all contents of /usr/local,
and then

	cd ~/AsymptoteBuild
	cd glew-2.1.0
	make
	sudo make install

	cp /usr/local/lib/libGLEW.a ~/AsymptoteBuild/lib
	cd ~/AsymptoteBuild/include
	mkdir OpenGL
	cp /usr/local/include/GL/glew.h ~/AsymptoteBuild/include/OpenGL
	cp /usr/local/include/GL/glxew.h ~/AsymptoteBuild/include/OpenGL
	cp /usr/local/include/GL/wglew.h ~/AsymptoteBuild/include/OpenGL
	sudo rm -R /usr/local/lib
	sudo rm -R /usr/local/include

Then rename the contents of /usr/local to their original names.
	
	 


--------------------------------


To see which dylibs are called by asymptote:

	otool -L asy



