|
27 | 27 |
|
28 | 28 | require "nmatrix/mkmf" |
29 | 29 |
|
30 | | -#$INSTALLFILES = [['nmatrix.h', '$(archdir)'], ['nmatrix.hpp', '$(archdir)'], ['nmatrix_config.h', '$(archdir)'], ['nm_memory.h', '$(archdir)']] |
31 | | -if /cygwin|mingw/ =~ RUBY_PLATFORM |
32 | | - #$INSTALLFILES << ['libnmatrix.a', '$(archdir)'] |
| 30 | +# $INSTALLFILES = [['nmatrix.h', '$(archdir)'], ['nmatrix.hpp', '$(archdir)'], ['nmatrix_config.h', '$(archdir)'], ['nm_memory.h', '$(archdir)']] |
| 31 | +if /cygwin|mingw/.match?(RUBY_PLATFORM) |
| 32 | + # $INSTALLFILES << ['libnmatrix.a', '$(archdir)'] |
33 | 33 | end |
34 | 34 |
|
35 | 35 | $DEBUG = true |
36 | | -#not the right way to add this include directory |
37 | | -$CFLAGS = ["-Wall -Werror=return-type -I$(srcdir)/../nmatrix",$CFLAGS].join(" ") |
38 | | -$CXXFLAGS = ["-Wall -Werror=return-type -I$(srcdir)/../nmatrix",$CXXFLAGS].join(" ") |
39 | | -$CPPFLAGS = ["-Wall -Werror=return-type -I$(srcdir)/../nmatrix",$CPPFLAGS].join(" ") |
| 36 | +# not the right way to add this include directory |
| 37 | +$CFLAGS = ["-Wall -Werror=return-type -I$(srcdir)/../nmatrix", $CFLAGS].join(" ") |
| 38 | +$CXXFLAGS = ["-Wall -Werror=return-type -I$(srcdir)/../nmatrix", $CXXFLAGS].join(" ") |
| 39 | +$CPPFLAGS = ["-Wall -Werror=return-type -I$(srcdir)/../nmatrix", $CPPFLAGS].join(" ") |
40 | 40 |
|
41 | 41 | # When adding objects here, make sure their directories are included in CLEANOBJS down at the bottom of extconf.rb. |
42 | 42 | # Why not just autogenerate this list from all .c/.cpp files in directory? |
43 | | -basenames = %w{nmatrix_atlas math_atlas} |
| 43 | +basenames = %w[nmatrix_atlas math_atlas] |
44 | 44 | $objs = basenames.map { |b| "#{b}.o" } |
45 | 45 | $srcs = basenames.map { |b| "#{b}.cpp" } |
46 | 46 |
|
47 | 47 | # The next line allows the user to supply --with-atlas-dir=/usr/local/atlas, |
48 | 48 | # --with-atlas-lib or --with-atlas-include and tell the compiler where to look |
49 | 49 | # for ATLAS. The same for all the others |
50 | 50 | # |
51 | | -#dir_config("clapack", ["/usr/local/atlas/include"], []) |
| 51 | +# dir_config("clapack", ["/usr/local/atlas/include"], []) |
52 | 52 | # |
53 | 53 | # |
54 | 54 |
|
|
60 | 60 |
|
61 | 61 | idefaults = {lapack: ["/usr/include/atlas"], |
62 | 62 | cblas: ["/usr/local/atlas/include", "/usr/include/atlas"], |
63 | | - atlas: ["/usr/local/atlas/include", "/usr/include/atlas"]} |
| 63 | + atlas: ["/usr/local/atlas/include", "/usr/include/atlas"],} |
64 | 64 |
|
65 | 65 | # For some reason, if we try to look for /usr/lib64/atlas on a Mac OS X Mavericks system, and the directory does not |
66 | 66 | # exist, it will give a linker error -- even if the lib dir is already correctly included with -L. So we need to check |
67 | 67 | # that Dir.exists?(d) for each. |
68 | | -ldefaults = {lapack: ["/usr/local/lib", "/usr/local/atlas/lib", "/usr/lib64/atlas"].delete_if { |d| !Dir.exists?(d) }, |
69 | | - cblas: ["/usr/local/lib", "/usr/local/atlas/lib", "/usr/lib64/atlas"].delete_if { |d| !Dir.exists?(d) }, |
70 | | - atlas: ["/usr/local/lib", "/usr/local/atlas/lib", "/usr/lib", "/usr/lib64/atlas"].delete_if { |d| !Dir.exists?(d) }} |
| 68 | +ldefaults = {lapack: ["/usr/local/lib", "/usr/local/atlas/lib", "/usr/lib64/atlas"].delete_if { |d| !Dir.exist?(d) }, |
| 69 | + cblas: ["/usr/local/lib", "/usr/local/atlas/lib", "/usr/lib64/atlas"].delete_if { |d| !Dir.exist?(d) }, |
| 70 | + atlas: ["/usr/local/lib", "/usr/local/atlas/lib", "/usr/lib", "/usr/lib64/atlas"].delete_if { |d| !Dir.exist?(d) },} |
71 | 71 |
|
72 | 72 | if have_library("clapack") # Usually only applies for Mac OS X |
73 | 73 | $libs += " -lclapack " |
|
94 | 94 | have_header("clapack.h") |
95 | 95 | end |
96 | 96 |
|
97 | | - |
98 | 97 | # Although have_func is supposed to take a list as its second argument, I find that it simply |
99 | 98 | # applies a :to_s to the second arg and doesn't actually check each one. We may want to put |
100 | 99 | # have_func calls inside an :each block which checks atlas/clapack.h, cblas.h, clapack.h, and |
|
105 | 104 |
|
106 | 105 | have_func("cblas_dgemm", "cblas.h") |
107 | 106 |
|
108 | | -#have_func("rb_scan_args", "ruby.h") |
| 107 | +# have_func("rb_scan_args", "ruby.h") |
109 | 108 |
|
110 | | -#find_library("lapack", "clapack_dgetrf") |
111 | | -#find_library("cblas", "cblas_dgemm") |
112 | | -#find_library("atlas", "ATL_dgemmNN") |
| 109 | +# find_library("lapack", "clapack_dgetrf") |
| 110 | +# find_library("cblas", "cblas_dgemm") |
| 111 | +# find_library("atlas", "ATL_dgemmNN") |
113 | 112 | # Order matters here: ATLAS has to go after LAPACK: http://mail.scipy.org/pipermail/scipy-user/2007-January/010717.html |
114 | 113 | $libs += " -llapack -lcblas -latlas " |
115 | | -#$libs += " -lprofiler " |
| 114 | +# $libs += " -lprofiler " |
116 | 115 |
|
117 | 116 | create_conf_h("nmatrix_atlas_config.h") |
118 | 117 | create_makefile("nmatrix_atlas") |
119 | 118 |
|
120 | 119 | # to clean up object files in subdirectories: |
121 | | -open('Makefile', 'a') do |f| |
122 | | - clean_objs_paths = %w{ }.map { |d| "#{d}/*.#{CONFIG["OBJEXT"]}" } |
123 | | - f.write("CLEANOBJS := $(CLEANOBJS) #{clean_objs_paths.join(' ')}") |
| 120 | +open("Makefile", "a") do |f| |
| 121 | + clean_objs_paths = %w[].map { |d| "#{d}/*.#{CONFIG["OBJEXT"]}" } |
| 122 | + f.write("CLEANOBJS := $(CLEANOBJS) #{clean_objs_paths.join(" ")}") |
124 | 123 | end |
0 commit comments