@@ -26,6 +26,32 @@ DPCPP=
26
26
# enables ecolab for the MXE environment
27
27
MXE =
28
28
29
+ # choose 32 bits by preference
30
+ ifdef MXE
31
+ MXE_32bit =$(shell if which i686-w64-mingw32.shared-g++>&/dev/null; then echo 1; fi)
32
+ MXE_64bit =$(shell if which x86_64-w64-mingw32.shared-g++>&/dev/null; then echo 1; fi)
33
+ ifeq ($(MXE_32bit),1)
34
+ MXE_PREFIX =i686-w64-mingw32.shared
35
+ else
36
+ ifeq ($(MXE_64bit),1)
37
+ MXE_PREFIX =x86_64-w64-mingw32.shared
38
+ else
39
+ $(error "MXE compiler not found")
40
+ endif
41
+ BOOST_EXT =-mt-x64
42
+ endif
43
+
44
+ # force 64 bit build
45
+ ifdef MXE64
46
+ MXE_64bit =$(shell if which x86_64-w64-mingw32.shared-g++>&/dev/null; then echo 1; fi)
47
+ ifeq ($(MXE_64bit),1)
48
+ MXE_PREFIX =x86_64-w64-mingw32.shared
49
+ else
50
+ $(error "MXE compiler not found")
51
+ endif
52
+ endif
53
+ endif
54
+
29
55
FLAGS+=-DECOLAB_HOME =\"$(ECOLAB_HOME ) \"
30
56
31
57
ifdef MPI_DEBUG
@@ -49,127 +75,123 @@ ICC=
49
75
AQUA =
50
76
51
77
ifneq ($(MAKECMDGOALS ) ,clean)
52
- # configuration variables generated by make configure
53
- include $(ECOLAB_HOME ) /include/Makefile.config
78
+ # configuration variables generated by make configure
79
+ include $(ECOLAB_HOME ) /include/Makefile.config
54
80
endif
55
81
56
82
.SUFFIXES : .cd .d .rc $(SUFFIXES )
57
83
VPATH =$(ECOLAB_HOME ) /classdesc $(ECOLAB_HOME ) /classdesc/json5_parser/json5_parser $(ECOLAB_HOME ) /graphcode $(ECOLAB_HOME ) /include
58
84
PATH: =$(ECOLAB_HOME ) /bin:$(PATH ) :$(HOME ) /usr/bin
59
85
CLASSDESC =$(ECOLAB_HOME ) /bin/classdesc
60
- PKG_CONFIG_PATH: =$(HOME ) /usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig:$(PKG_CONFIG_PATH )
61
- PKG_CONFIG =env PKG_CONFIG_PATH=$(PKG_CONFIG_PATH ) pkg-config
62
-
63
- # where to look for installed software (prefix values)
64
- # nb Cygwin does not like /usr put here. Add it to the search command
65
- DIRS =$(ECOLAB_HOME ) $(HOME ) /usr /usr/local /opt/local /usr/X11R6
66
- # a search mechanism to find a particular file
67
- # use as $(call search,name)
86
+
68
87
ifdef MXE
69
- search =$(firstword $(foreach dir,$(DIRS ) ,$(wildcard $(dir ) /$(1 ) ) ) )
88
+ # rewrite ecolab home to be the mxe one
89
+ ifeq ($(ECOLAB_HOME),$(HOME)/usr/ecolab)
90
+ ECOLAB_HOME =$(HOME ) /usr/mxe/ecolab
91
+ endif
92
+ # where to look for installed software (prefix values)
93
+ DIRS =$(ECOLAB_HOME ) $(HOME ) /usr/mxe $(subst bin/$(CPLUSPLUS ) ,$(MXE_PREFIX ) ,$(shell which $(CPLUSPLUS ) ) )
94
+
95
+ # a search mechanism to find a particular file
96
+ # use as $(call search,name)
97
+ search =$(firstword $(foreach dir,$(DIRS ) ,$(wildcard $(dir ) /$(1 ) ) ) )
98
+
99
+ # xdr on MXE is positively ancient, so just disable it here
100
+ XDR =
101
+ PKG_CONFIG_PATH: =$(HOME ) /usr/mxe/lib/pkgconfig:$(PKG_CONFIG_PATH )
102
+ PKG_CONFIG =env PKG_CONFIG_PATH=$(PKG_CONFIG_PATH ) $(MXE_PREFIX ) -pkg-config
103
+ LIBS+ =-lgdiplus
104
+
70
105
else
71
- search =$(firstword $(foreach dir,$(DIRS ) /usr,$(wildcard $(dir ) /$(1 ) ) ) )
106
+ # where to look for installed software (prefix values)
107
+ # nb Cygwin does not like /usr put here. Add it to the search command
108
+ DIRS =$(ECOLAB_HOME ) $(HOME ) /usr /usr/local /opt/local /usr/X11R6
109
+ # a search mechanism to find a particular file
110
+ # use as $(call search,name)
111
+ search =$(firstword $(foreach dir,$(DIRS ) /usr,$(wildcard $(dir ) /$(1 ) ) ) )
112
+
113
+ PKG_CONFIG_PATH: =$(HOME ) /usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig:$(PKG_CONFIG_PATH )
114
+ PKG_CONFIG =env PKG_CONFIG_PATH=$(PKG_CONFIG_PATH ) pkg-config
72
115
endif
73
116
117
+ # add standard list of search paths, -L/usr/lib32 must be before this statement
118
+ LIBS+ = $(DIRS:%=-L%/lib )
119
+ FLAGS+=$(DIRS:% =-I%/include)
120
+
74
121
# where to find classdesc header files (eg pack_base.h)
75
122
CDINCLUDE =$(ECOLAB_HOME ) /include
76
123
77
124
ifdef AEGIS
78
- # unused-variable warnings fail certain RAII usages in C++
79
- FLAGS+ =-Werror -Wall -Wno-unused-variable -Wno-unused-function
80
- # for now, we maintain the code for C++98 standard
81
- # noexcept-type is a warning about ABI changes coming in C++17
82
- # Travis complains about unused-local-typedefs, so shut it up.
83
- CXXFLAGS+ =-Wno-noexcept-type -Wno-unused-local-typedefs -std=c++20
125
+ # unused-variable warnings fail certain RAII usages in C++
126
+ FLAGS+ =-Werror -Wall -Wno-unused-variable -Wno-unused-function
127
+ # for now, we maintain the code for C++98 standard
128
+ # noexcept-type is a warning about ABI changes coming in C++17
129
+ # Travis complains about unused-local-typedefs, so shut it up.
130
+ CXXFLAGS+ =-Wno-noexcept-type -Wno-unused-local-typedefs -std=c++20
84
131
endif
85
132
86
- # needed for generating .so files
87
133
ifndef MXE
88
- FLAGS+ =-fPIC
89
- endif
90
-
91
- # use mpicc etc by default if MPI set
92
- ifdef MPI
93
- HAVE_mpiCC =$(shell if which mpiCC>&/dev/null; then echo 1; fi)
94
- CC =mpicc
95
- ifeq ($(HAVE_mpiCC ) ,1)
96
- CPLUSPLUS =mpiCC
97
- else
98
- # newer versions of mpich use this name!!
99
- CPLUSPLUS =mpicxx
100
- endif
101
- LINK =$(CPLUSPLUS )
102
- CPP =$(CPLUSPLUS ) -E
103
-
104
- # disable inclusion of mpi++.h in the MPICH case (don't know what the problem is here)
105
- FLAGS+ =-UHAVE_MPI_CPP
106
- else
107
- # Engage Intel OneAPI compiler
108
- ifdef DPCPP
109
- CPLUSPLUS =icpx
110
- SYCL+ =-fsycl
111
- # -std=c++20 used to suppress warning messages
112
- FLAGS+=-std =c++20 -Wno-vla-cxx-extension
113
- else
114
- CPLUSPLUS =g++
115
- endif
116
- CC =gcc
117
- LINK =$(CPLUSPLUS ) $(SYCL )
118
- CPP =g++ -E
119
- endif
120
-
121
- ifdef CCACHE
122
- CC: =ccache $(CC )
123
- CPLUSPLUS: =ccache $(CPLUSPLUS )
124
- endif
125
-
126
- # choose 32 bits by preference
127
- ifdef MXE
128
- MXE_32bit =$(shell if which i686-w64-mingw32.shared-g++>&/dev/null; then echo 1; fi)
129
- MXE_64bit =$(shell if which x86_64-w64-mingw32.shared-g++>&/dev/null; then echo 1; fi)
130
- ifeq ($(MXE_32bit ) ,1)
131
- MXE_PREFIX =i686-w64-mingw32.shared
132
- else
133
- ifeq ($(MXE_64bit ) ,1)
134
- MXE_PREFIX =x86_64-w64-mingw32.shared
135
- else
136
- $(error "MXE compiler not found")
137
- endif
138
- endif
139
-
140
- # force 64 bit build
141
- ifdef MXE64
142
- MXE_64bit =$(shell if which x86_64-w64-mingw32.shared-g++>&/dev/null; then echo 1; fi)
143
- ifeq ($(MXE_64bit ) ,1)
144
- MXE_PREFIX =x86_64-w64-mingw32.shared
145
- else
146
- $(error "MXE compiler not found")
147
- endif
148
- endif
149
-
150
- GCC =1
151
- FLAGS+ = -DNO_FWD_DECLARE_STL -DMXE -DSTATIC_BUILD
152
- CC =$(MXE_PREFIX ) -gcc
153
- CPLUSPLUS =$(MXE_PREFIX ) -g++
154
- LINK =$(CPLUSPLUS )
155
- CPP =$(CPLUSPLUS ) -E
156
- # rewrite ecolab home to be the mxe one
157
- ifeq ($(ECOLAB_HOME ) ,$(HOME ) /usr/ecolab)
158
- ECOLAB_HOME =$(HOME ) /usr/mxe/ecolab
159
- endif
160
- DIRS =$(ECOLAB_HOME ) $(HOME ) /usr/mxe $(subst bin/$(CPLUSPLUS ) ,$(MXE_PREFIX ) ,$(shell which $(CPLUSPLUS ) ) )
161
- PKG_CONFIG_PATH: =$(HOME ) /usr/mxe/lib/pkgconfig:$(PKG_CONFIG_PATH )
162
- PKG_CONFIG =env PKG_CONFIG_PATH=$(PKG_CONFIG_PATH ) $(MXE_PREFIX ) -pkg-config
163
- LIBS+ =-lgdiplus
164
-
165
- # xdr on MXE is positively ancient, so just disable it here
166
- XDR =
167
-
168
- # rule for running the resource compiler
169
- .rc.o :
134
+ # needed for generating .so files
135
+ FLAGS+ =-fPIC
136
+
137
+ # use mpicc etc by default if MPI set
138
+ ifdef MPI
139
+ HAVE_mpiCC =$(shell if which mpiCC>&/dev/null; then echo 1; fi)
140
+ CC =mpicc
141
+ ifeq ($(HAVE_mpiCC),1)
142
+ CPLUSPLUS =mpiCC
143
+ else
144
+ # newer versions of mpich use this name!!
145
+ CPLUSPLUS =mpicxx
146
+ endif
147
+ LINK =$(CPLUSPLUS )
148
+ CPP =$(CPLUSPLUS ) -E
149
+
150
+ # disable inclusion of mpi++.h in the MPICH case (don't know what the problem is here)
151
+ FLAGS+ =-UHAVE_MPI_CPP
152
+ else
153
+ # Engage Intel OneAPI compiler
154
+ ifdef DPCPP
155
+ CPLUSPLUS =icpx
156
+ SYCL+ =-fsycl
157
+ # -std=c++20 used to suppress warning messages
158
+ FLAGS+=-std =c++20 -Wno-vla-cxx-extension
159
+ else
160
+ CPLUSPLUS =g++
161
+ endif
162
+ CC =gcc
163
+ LINK =$(CPLUSPLUS ) $(SYCL )
164
+ CPP =g++ -E
165
+ endif
166
+
167
+ ifdef CCACHE
168
+ CC: =ccache $(CC )
169
+ CPLUSPLUS: =ccache $(CPLUSPLUS )
170
+ endif
171
+
172
+ BOOST_EXT =
173
+ # try to autonomously figure out which boost extension we should be using
174
+ ifeq ($(shell if $(CPLUSPLUS) test/testmain.cc $(LIBS) -lboost_system>&/dev/null; then echo 1; else echo 0; fi),0)
175
+ ifeq ($(shell if $(CPLUSPLUS) test/testmain.cc $(LIBS) -lboost_system-mt>&/dev/null; then echo 1; else echo 0; fi),1)
176
+ BOOST_EXT =-mt
177
+ else
178
+ $(warning cannot figure out boost extension)
179
+ endif
180
+ endif
181
+ $(warning Boost extension=$(BOOST_EXT))
182
+ else # MXE
183
+ GCC =1
184
+ FLAGS+ = -DNO_FWD_DECLARE_STL -DMXE -DSTATIC_BUILD
185
+ CC =$(MXE_PREFIX ) -gcc
186
+ CPLUSPLUS =$(MXE_PREFIX ) -g++
187
+ LINK =$(CPLUSPLUS )
188
+ CPP =$(CPLUSPLUS ) -E
189
+
190
+ # rule for running the resource compiler
191
+ .rc.o :
170
192
$(MXE_PREFIX ) -windres -O coff -i $< -o $@
171
193
172
- .rc.d :
194
+ .rc.d :
173
195
touch $@
174
196
endif
175
197
@@ -196,7 +218,7 @@ endif
196
218
ECOLIBS =$(ECOLAB_HOME ) /lib/libecolab$(ECOLIBS_EXT ) .a
197
219
198
220
# why is boost_thread required here?
199
- LIBS+ =-L$(ECOLAB_HOME ) /lib -lecolab$(ECOLIBS_EXT ) -lboost_thread
221
+ LIBS+ =-L$(ECOLAB_HOME ) /lib -lecolab$(ECOLIBS_EXT ) -lboost_thread$( BOOST_EXT )
200
222
FLAGS+ =-I. -I$(ECOLAB_HOME ) /classdesc -I$(ECOLAB_HOME ) /classdesc/json5_parser/json5_parser -I$(ECOLAB_HOME ) /graphcode -I$(ECOLAB_HOME ) /include -I$(ECOLAB_HOME ) /Ouroboros-SYCL/include -DHASH_TCL_hash
201
223
202
224
# The following section uses GNU Make specific syntax. If not using
@@ -284,10 +306,6 @@ FLAGS+=-DTR1
284
306
endif
285
307
endif
286
308
287
- # add standard list of search paths, -L/usr/lib32 must be before this statement
288
- LIBS+ = $(DIRS:%=-L%/lib )
289
- FLAGS+=$(DIRS:% =-I%/include)
290
-
291
309
# canonicalise CYGWIN's OS name
292
310
ifeq ($(findstring CYGWIN,$(OS ) ) ,CYGWIN)
293
311
OS =CYGWIN
@@ -590,7 +608,8 @@ LINK+=$(OPT)
590
608
LIBMODS =
591
609
592
610
# modules to include on the MODLINK command line
593
- ALWAYSLINK =tcl_arrays tclgraph analysis random cairo_types plot
611
+ # ALWAYSLINK=analysis random cairo_types plot
612
+ ALWAYSLINK =
594
613
595
614
# for some reason, the -u option doesn't work with MXE
596
615
ifdef MXE
0 commit comments