Ticket #46650: octave-tsa-libgcc.diff

File octave-tsa-libgcc.diff, 6.7 KB (added by michaelld (Michael Dickens), 10 years ago)
  • Portfile

     
    44PortSystem          1.0
    55PortGroup           octave 1.0
    66
    7 octave.setup        tsa 4.2.7
     7octave.setup        tsa 4.2.8
    88platforms           darwin
    99license             GPL-3+
    1010maintainers         gmail.com:mschamschula openmaintainer
     
    1212                    methods for time series analysis.
    1313long_description    ${description}
    1414
    15 checksums           rmd160  f19d0439adadb9121e7deab9f01532d692a64d65 \
    16                     sha256  48c22265ed0962c09ef7c1777628afc5d9a206089c674b7b9727a0c5a545b229
     15checksums           rmd160  a24c46e1d6118565c5f1d356eed72b27136a7a56 \
     16                    sha256  1eb37276ba26658caa1d91d36331981ed1d146384a1bdaca0df9077c7ded57ed
    1717
    1818patchfiles          patch-src_Makefile.diff
     19
     20# TSA uses libgomp, which is provided by libgcc and/or GCC4X ports.
     21# allow for libgcc or libgcc-devel
     22
     23depends_lib-append  path:lib/libgcc/libgcc_s.1.dylib:libgcc
     24
     25configure.env-append "LOCAL_FLAGS=-L${prefix}/lib -L${prefix}/lib/libgcc -lgomp.1"
  • files/patch-src_Makefile.diff

     
    1 --- src/Makefile.orig   2014-01-12 14:29:06.000000000 -0600
    2 +++ src/Makefile        2014-11-28 13:18:52.000000000 -0600
    3 @@ -41,14 +41,19 @@
     1--- src/Makefile.orig   2015-01-24 13:19:09.000000000 -0500
     2+++ src/Makefile        2015-01-24 13:20:43.000000000 -0500
     3@@ -10,116 +10,36 @@
     4 # Octave - global install  (e.g. from debian package)
     5 # OCTAVE_VERSION=
     6 # Better alternative: define an OCTAVE_VERSION bash variable (or in .bashrc or .profile)
     7-OCTAVE_VERSION=-3.8.2
     8+#OCTAVE_VERSION=-3.8.2
    49 
    5  
    6  
     10-# Matlab configuration
     11-# MATLABDIR = /usr/local/MATLAB/R2010b
     12-# comment the following line if you use MATLAB on 32-bit operating system
     13-MEX_OPTION += -largeArrayDims
     14-
     15-# Mingw crosscompiler: available at http://www.nongnu.org/mingw-cross-env/
     16-CROSS   = $(HOME)/src/mxe.github.schloegl/usr/bin/i686-w64-mingw32.static
     17-CROSS64 = $(HOME)/src/mxe.github.schloegl/usr/bin/x86_64-w64-mingw32.static
     18-# include directory for Win32-Matlab include
     19-W32MAT_INC = -I$(HOME)/bin/win32/Matlab/R2010b/extern/include/
     20-W64MAT_INC = -I$(HOME)/bin/win64/Matlab/R2010b/extern/include/
     21-# path to GNUMEX libraries, available from here http://sourceforge.net/projects/gnumex/
     22-GNUMEX   = $(HOME)/bin/win32/gnumex
     23-GNUMEX64 = $(HOME)/bin/win64/gnumex
     24-# building gnumex64 was difficult, these hints were quite useful:
     25-# http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinZvxgC9ezp2P3UCX_a7TAUYuVsp2U40MQUV6qr%40mail.gmail.com&forum_name=gnumex-users
     26-# Instead of building "mex shortpath.c" and "mex uigetpath.c", I used empty m-functions within argout=argin;
     27-####################################################
     28-W32MAT_INC += -I$(subst /usr/bin/,/usr/,$(CROSS))/include/
     29-W64MAT_INC += -I$(subst /usr/bin/,/usr/,$(CROSS64))/include/
     30-LDLIBS_W32 = $(subst /usr/bin/,/usr/,$(CROSS))/lib/
     31-LDLIBS_W64 = $(subst /usr/bin/,/usr/,$(CROSS64))/lib/
     32-W32_LIBS  = $(LDLIBS_W32)liblapack.a
     33-W64_LIBS  = $(LDLIBS_W64)liblapack.a
     34-W32_LIBS += $(LDLIBS_W32)libblas.a
     35-W64_LIBS += $(LDLIBS_W64)libblas.a
     36-
     37-
     38-
    739-CC     = gcc
    840-CXX    = g++
    941+#CC    = gcc
    1042+#CXX   = g++
    1143 CFLAGS         = -fopenmp -Wall -Wextra -Wconversion -O2 -fPIC
    12  OCTMEX = mkoctfile$(OCTAVE_VERSION) --mex
     44-OCTMEX = mkoctfile$(OCTAVE_VERSION) --mex
    1345 RM      = rm
    1446 
    1547 MEX_OPTION  += -lgomp CC\#$(CXX) CXX\#$(CXX) CFLAGS\#"$(CFLAGS)" CXXFLAGS\#"$(CFLAGS)"
    1648-MATMEX      = $(MATLABDIR)/bin/mex $(MEX_OPTION)
    17 +MKOCTFILE = mkoctfile$(OCTAVE_VERSION)
     49+MKOCTFILE = mkoctfile$(OCTAVE_VERSION) -v
    1850+OCTMEX = $(MKOCTFILE) --mex
    1951+
    2052+FLIBS = ${shell $(MKOCTFILE) -p FLIBS}
     
    2355 
    2456 PROGS = covm_mex.mex sumskipnan_mex.mex #
    2557 
    26 @@ -88,10 +93,10 @@
     58 ### per default only the mex-files for octave are built
     59-mex4o octave: $(PROGS)
     60-
     61+octave: $(PROGS)
     62 
     63-### Matlab configuration - search for a matlab directory if not defined above
     64-ifndef MATLABDIR
     65-  ifneq (,$(shell ls -1 /usr/local/ |grep MATLAB))
     66-    # use oldest, typically mex-files a compatible with newer Matlab versions
     67-    MATLABDIR=/usr/local/MATLAB/$(shell ls -1t /usr/local/MATLAB/  |grep "^R*" |head -1)
     68-    # alternatively, use latest matlab version
     69-    #MATLABDIR=$(shell ls -dt1 /usr/local/MATLAB/R* |head -1)
     70-  endif
     71-endif
     72-
     73-### if the MATLABDIR has been found or defined
     74-ifneq (,MATLABDIR)
     75-  ifneq (,$(shell ls -1 $(MATLABDIR)/bin/mexext))
     76-    MEX_EXT=$(shell $(MATLABDIR)/bin/mexext)
     77-    mex4m matlab: $(patsubst %.mex, %.$(MEX_EXT), $(PROGS))
     78-  endif
     79-endif
     80-
     81-
     82-mexw32 win32:  $(patsubst %.mex, %.mexw32, $(PROGS))
     83-mexw64 win64:  $(patsubst %.mex, %.mexw64, $(PROGS))
     84-all:    octave win32 win64 mex4m
     85+all:    octave
     86 
     87 clean:
     88        -$(RM) *.o *.obj *.o64 core octave-core *.oct *~ *.mex*
     89 
     90-
     91 #########################################################
     92-
    2793 #      Octave, MATLAB on Linux
    2894 #########################################################
    2995 %.oct: %.cc
    3096-       mkoctfile$(OCTAVE_VERSION) "$<"
    31 +       $(MKOCTFILE) $<
     97+       $(MKOCTFILE) "$<"
    3298 
    3399 %.mex: %.cpp
    34 -       $(OCTMEX) "$<"  -lgomp -llapack -lblas     ## Octave
    35 +       INCFLAGS="$(INCFLAGS) $(INC_CSTDLIB)" $(OCTMEX) $< $(FLIBS) -lgomp     ## Octave
    36  %.$(MEX_EXT): %.cpp
    37         $(MATMEX) "$<"  -lgomp -llapack -lblas     ## Matlab
    38  
     100-       $(OCTMEX) "$<"  -lgomp -llapack -lblas
     101-%.$(MEX_EXT): %.cpp
     102-       $(MATMEX) "$<"  -lgomp -llapack -lblas
     103-
     104-
     105-#########################################################
     106-#      MATLAB/WIN32
     107-#########################################################
     108-%.obj: %.cpp
     109-       $(CROSS)-$(CXX) -fopenmp -c -DMATLAB_MEX_FILE -x c++ -o "$@" $(W32MAT_INC) -O2 -DMX_COMPAT_32 "$<"
     110-%.obj: %.c
     111-       $(CROSS)-$(CXX) -fopenmp -c -DMATLAB_MEX_FILE -x c++ -o "$@" $(W32MAT_INC) -O2 -DMX_COMPAT_32 "$<"
     112-
     113-%.mexw32: %.obj
     114-       $(CROSS)-$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" -llibmx -llibmex -llibmat -lcholmod -lgomp -lpthread -L$(LDLIBS_W32) -lblas -llapack
     115-
     116-
     117-#########################################################
     118-#      MATLAB/WIN64
     119-#########################################################
     120-
     121-## ToDO: fix OpenMP support: currently -fopenmp causes Matlab to crash
     122-%.o64: %.cpp
     123-       $(CROSS64)-$(CXX) -c -DMATLAB_MEX_FILE -x c++ -o "$@" $(W64MAT_INC) -O2 "$<"
     124-%.o64: %.c
     125-       $(CROSS64)-$(CXX) -c -DMATLAB_MEX_FILE -x c++ -o "$@" $(W64MAT_INC) -O2 "$<"
     126-
     127-%.mexw64: %.o64
     128-       $(CROSS64)-$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" -llibmx -llibmex -llibmat -lcholmod -lgomp -lpthread -L$(LDLIBS_W64) -lblas -llapack
     129-       
     130-       
     131-
     132+       INCFLAGS="$(INCFLAGS) $(INC_CSTDLIB)" $(OCTMEX) $< $(FLIBS) $(LOCAL_FLAGS)