In the current state of sage starting from scratch with clang/clang++
via 
CC=clang CXX=clang++ make
will trigger the building of sage’s gcc (which is OK on OS X since
you still need gfortran).
The problem is that once you build sage’s gcc, there is a clause
in src/bin/sage-env to use sage’s gcc/g++/gfrotran if it is present
in SAGE_LOCAL/bin:
# Override CC, CPP, CXX, FC if the GCC spkg was installed.
if [ -x "$SAGE_LOCAL/bin/gcc" ]; then
    CC=gcc
fi
if [ -x "$SAGE_LOCAL/bin/cpp" ]; then
    CPP=cpp
fi
if [ -x "$SAGE_LOCAL/bin/g++" ]; then
    CXX=g++
fi
if [ -x "$SAGE_LOCAL/bin/gfortran" ]; then
    FC=gfortran
fi
export CC CPP CXX FC

So working on OS X I dirty patched sage-env:
@@ -511,15 +515,15 @@ if [ "$UNAME" = "Darwin" ]; then
 fi
 
 # Override CC, CPP, CXX, FC if the GCC spkg was installed.
-if [ -x "$SAGE_LOCAL/bin/gcc" ]; then
-    CC=gcc
-fi
-if [ -x "$SAGE_LOCAL/bin/cpp" ]; then
-    CPP=cpp
-fi
-if [ -x "$SAGE_LOCAL/bin/g++" ]; then
-    CXX=g++
-fi
+#if [ -x "$SAGE_LOCAL/bin/gcc" ]; then
+#    CC=gcc
+#fi
+#if [ -x "$SAGE_LOCAL/bin/cpp" ]; then
+#    CPP=cpp
+#fi
+#if [ -x "$SAGE_LOCAL/bin/g++" ]; then
+#    CXX=g++
+#fi
 if [ -x "$SAGE_LOCAL/bin/gfortran" ]; then
     FC=gfortran
 fi

So with that patch on OS X and starting with
CC=clang CXX=clang++ make
gcc will be built but clang/clang++/gfortran will be used.

Something a little bit less dirty should be done once
we are more advanced.

But at the moment compiling sagelib seems to point to a variety
of problems from numpy to cython and probably other…

François

> On 3/10/2016, at 21:43, Dima Pasechnik <dimp...@gmail.com> wrote:
> 
> What exactly should be set to start the Sage build using clang rather than 
> gcc?
> 
> 
> On Monday, October 3, 2016 at 6:32:45 AM UTC, François wrote:
> 
> > On 3/10/2016, at 09:33, François Bissey <francoi...@canterbury.ac.nz> 
> > wrote: 
> > 
> >> linbox 
> > 
> > No news from upstream at 
> > https://github.com/linbox-team/linbox/issues/39 
> > contributions welome. 
> 
> Well as it turns out the problem is only in the interface with 
> fplll which we are going to disable in the next fplll upgrade. 
> Word from upstream is that this particular interface is not 
> currently used by sage so it is all right to disable it. 
> 
> With fplll disabled in linbox all the standard packages are 
> now successfully building and installing with clang. 
> 
> The next challenge is sagelib itself: 
> [sagelib-7.4.beta6] [  1/387] clang -fno-strict-aliasing 
> -I/Users/fbissey/build/sage/local/var/tmp/sage/build/python2-2.7.10.p2/include
>  -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused 
> -I/Users/fbissey/build/sage/local/lib/python2.7/site-packages/cysignals 
> -I/Users/fbissey/build/sage/local/include 
> -I/Users/fbissey/build/sage/local/include/python2.7 
> -I/Users/fbissey/build/sage/local/lib/python2.7/site-packages/numpy/core/include
>  -I/Users/fbissey/build/sage/src -I/Users/fbissey/build/sage/src/sage/ext 
> -I/Users/fbissey/build/sage/src/build/cythonized 
> -I/Users/fbissey/build/sage/src/build/cythonized/sage/ext 
> -I/Users/fbissey/build/sage/local/include/python2.7 -c 
> /Users/fbissey/build/sage/src/build/cythonized/sage/finance/time_series.c -o 
> build/temp.macosx-10.9-x86_64-2.7/Users/fbissey/build/sage/src/build/cythonized/sage/finance/time_series.o
>  -fno-strict-aliasing 
> [sagelib-7.4.beta6] In file included from 
> /Users/fbissey/build/sage/src/build/cythonized/sage/finance/time_series.c:317:
>  
> [sagelib-7.4.beta6] In file included from 
> /Users/fbissey/build/sage/local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
>  
> [sagelib-7.4.beta6] In file included from 
> /Users/fbissey/build/sage/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
>  
> [sagelib-7.4.beta6] In file included from 
> /Users/fbissey/build/sage/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1777:
>  
> [sagelib-7.4.beta6] 
> /Users/fbissey/build/sage/local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2:
>  warning: "Using deprecated NumPy API, disable it by "          "#defining 
> NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings] 
> [sagelib-7.4.beta6] #warning "Using deprecated NumPy API, disable it by " \ 
> [sagelib-7.4.beta6]  ^ 
> [sagelib-7.4.beta6] 
> /Users/fbissey/build/sage/src/build/cythonized/sage/finance/time_series.c:15275:3:
>  error: non-void function 
> '__pyx_pf_4sage_7finance_11time_series_10TimeSeries_106numpy' should return a 
> value [-Wreturn-type] 
> [sagelib-7.4.beta6]   import_array(); 
> [sagelib-7.4.beta6]   ^ 
> [sagelib-7.4.beta6] 
> /Users/fbissey/build/sage/local/lib/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1532:144:
>  note: expanded from macro 'import_array' 
> [sagelib-7.4.beta6] #define import_array() {if (_import_array() < 0) 
> {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray 
> failed to import"); return NUMPY_IMPORT_ARRAY_RETVAL; } } 
> [sagelib-7.4.beta6]                                                           
>                                                                               
>        ^ 
> [sagelib-7.4.beta6] 1 warning and 1 error generated. 
> 
> François 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to