Comments (5)
Since the OP is already quite long, just wanted to add this comment:
Having realized that the default is C++17, I wanted to see how the build would behave for C++11; so I replaced this line:
diff --git a/GNUmakefile b/GNUmakefile
index 2033339..c263cf6 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -156,7 +156,7 @@ ifeq ($(OS), windows_nt)
EXEPOSTFIX=.exe
endif
ifeq ($(OSTYPE), cygwin)
- $(info using settings for OS=Windows_NT, OSTYPE=cygwin)
+ $(info using settings for OS=Windows_NT, OSTYPE=cygwin)
# call make OSTYPE=cygwin
BSWITCH=103
DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
@@ -164,7 +164,7 @@ ifeq ($(OS), windows_nt)
DUMA_DYN_DEPS=
DUMASO=
CFLAGS=-g -O0 -DWIN32 -Wall -Wextra
- CPPFLAGS=-g -O0 -DWIN32 -Wall -Wextra
+ CPPFLAGS=-g -O0 -DWIN32 -Wall -Wextra -std=gnu++11
LIBS=
EXEPOSTFIX=.exe
endif
... and now the process looks like this:
$ make -f ./GNUmakefile OS=$(echo "$OS" | tr '[:upper:]' '[:lower:]' 2>/dev/null || true) OSTYPE=cygwin
using settings for OS=Windows_NT, OSTYPE=cygwin
using default prefix [/usr]
using default srcdir [.]
using default exec_prefix [/usr]
./make_git_source_version.sh > ./verinfo.h
c++ -g -O0 -DWIN32 -Wall -Wextra -std=gnu++11 -c dumapp.cpp -o dumapp.o
dumapp.cpp: In function ‘void* duma_new_operator(std::size_t, _DUMA_Allocator, bool, const char*, int)’:
dumapp.cpp:166:29: warning: catching polymorphic type ‘class std::bad_alloc’ by value [-Wcatch-value=]
166 | catch (std::bad_alloc) // error occured in new_handler
| ^~~~~~~~~
cc -g -O0 -DWIN32 -Wall -Wextra -c duma.c -o duma.o
cc -g -O0 -DWIN32 -Wall -Wextra -c sem_inc.c -o sem_inc.o
cc -g -O0 -DWIN32 -Wall -Wextra -c print.c -o print.o
print.c: In function ‘DUMA_Abort’:
print.c:278:13: warning: variable ‘lenb’ set but not used [-Wunused-but-set-variable]
278 | int lena, lenb;
| ^~~~
print.c: In function ‘DUMA_Exit’:
print.c:363:13: warning: variable ‘lenb’ set but not used [-Wunused-but-set-variable]
363 | int lena, lenb;
| ^~~~
rm -f libduma.a
ar crv libduma.a dumapp.o duma.o sem_inc.o print.o
a - dumapp.o
a - duma.o
a - sem_inc.o
a - print.o
ranlib libduma.a
Build complete - you can now run make test.
$ make -f ./GNUmakefile OS=$(echo "$OS" | tr '[:upper:]' '[:lower:]' 2>/dev/null || true) OSTYPE=cygwin check
using settings for OS=Windows_NT, OSTYPE=cygwin
using default prefix [/usr]
using default srcdir [.]
using default exec_prefix [/usr]
./make_git_source_version.sh > ./verinfo.h
cc -g -O0 -DWIN32 -Wall -Wextra -c duma.c -o duma.o
rm -f libduma.a
ar crv libduma.a dumapp.o duma.o sem_inc.o print.o
a - dumapp.o
a - duma.o
a - sem_inc.o
a - print.o
ranlib libduma.a
cc -g -O0 -DWIN32 -Wall -Wextra -c tests/tstheap.c -o tstheap.o
rm -f tstheap.exe
cc -g -O0 -DWIN32 -Wall -Wextra tstheap.o libduma.a -o tstheap.exe
cc -g -O0 -DWIN32 -Wall -Wextra -c tests/dumatest.c -o dumatest.o
rm -f dumatest.exe
cc -g -O0 -DWIN32 -Wall -Wextra dumatest.o libduma.a -o dumatest.exe
cc -g -O0 -DWIN32 -Wall -Wextra -c tests/thread-test.c -o thread-test.o
rm -f thread-test.exe
cc -g -O0 -DWIN32 -Wall -Wextra thread-test.o libduma.a -o thread-test.exe
cc -g -O0 -DWIN32 -Wall -Wextra -c tests/testmt.c -o testmt.o
rm -f testmt.exe
cc -g -O0 -DWIN32 -Wall -Wextra testmt.o libduma.a -o testmt.exe
c++ -g -O0 -DWIN32 -Wall -Wextra -std=gnu++11 -c tests/dumatestpp.cpp -o dumatestpp.o
rm -f dumatestpp.exe
c++ -g -O0 -DWIN32 -Wall -Wextra -std=gnu++11 dumatestpp.o libduma.a -o dumatestpp.exe
c++ -g -O0 -DWIN32 -Wall -Wextra -std=gnu++11 -c tests/testoperators.cpp -o testoperators.o
tests/testoperators.cpp:40:65: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
40 | void * operator new( DUMA_SIZE_T ) throw(std::bad_alloc);
| ^~~~~
tests/testoperators.cpp:46:65: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
46 | void * operator new[]( DUMA_SIZE_T ) throw(std::bad_alloc);
| ^~~~~
tests/testoperators.cpp:53:81: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
53 | void * operator new( DUMA_SIZE_T, const char *, int ) throw( std::bad_alloc );
| ^~~~~
tests/testoperators.cpp:59:83: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
59 | void * operator new[]( DUMA_SIZE_T, const char *, int ) throw( std::bad_alloc );
| ^~~~~
tests/testoperators.cpp:73:1: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
73 | throw(std::bad_alloc)
| ^~~~~
tests/testoperators.cpp:104:1: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
104 | throw(std::bad_alloc)
| ^~~~~
tests/testoperators.cpp:132:1: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
132 | throw( std::bad_alloc )
| ^~~~~
tests/testoperators.cpp:160:1: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
160 | throw( std::bad_alloc )
| ^~~~~
rm -f testoperators.exe
c++ -g -O0 -DWIN32 -Wall -Wextra -std=gnu++11 testoperators.o libduma.a -o testoperators.exe
.
Testing DUMA (static library):
./dumatest.exe
DUMA 2.5.21-0-ge214a6e-dirty, built 10/11/21 08:07:13 (static library, EXPLICIT_INIT)
Copyright (C) 2006 Michael Eddington <[email protected]>
Copyright (C) 2002-2009 Hayati Ayguen <[email protected]>, Procitec GmbH
Copyright (C) 1987-1999 Bruce Perens <[email protected]>
.
./tstheap.exe 3072
DUMA 2.5.21-0-ge214a6e-dirty, built 10/11/21 08:07:13 (static library, EXPLICIT_INIT)
Copyright (C) 2006 Michael Eddington <[email protected]>
Copyright (C) 2002-2009 Hayati Ayguen <[email protected]>, Procitec GmbH
Copyright (C) 1987-1999 Bruce Perens <[email protected]>
.
./testoperators.exe
DUMA 2.5.21-0-ge214a6e-dirty, built 10/11/21 08:07:13 (static library, EXPLICIT_INIT)
Copyright (C) 2006 Michael Eddington <[email protected]>
Copyright (C) 2002-2009 Hayati Ayguen <[email protected]>, Procitec GmbH
Copyright (C) 1987-1999 Bruce Perens <[email protected]>
.
DUMA static confidence test PASSED.
So now the "dynamic exception specifications" are warnings, not errors, and the make test
/make check
proceeds to the end.
And, another note - I tried this patch, to build the dynamic library (the .dll
):
diff --git a/GNUmakefile b/GNUmakefile
index 2033339..c93e0fa 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -156,15 +156,16 @@ ifeq ($(OS), windows_nt)
EXEPOSTFIX=.exe
endif
ifeq ($(OSTYPE), cygwin)
- $(info using settings for OS=Windows_NT, OSTYPE=cygwin)
+ $(info using settings for OS=Windows_NT, OSTYPE=cygwin)
# call make OSTYPE=cygwin
BSWITCH=103
DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT
CURPATH=./
- DUMA_DYN_DEPS=
- DUMASO=
+ #DUMA_DYN_DEPS=
+ DUMASO=libduma.dll
+ DUMASO_LINK1=libduma.dll
CFLAGS=-g -O0 -DWIN32 -Wall -Wextra
- CPPFLAGS=-g -O0 -DWIN32 -Wall -Wextra
+ CPPFLAGS=-g -O0 -DWIN32 -Wall -Wextra -std=gnu++11
LIBS=
EXEPOSTFIX=.exe
endif
@@ -595,9 +596,9 @@ testmemlimit_so$(EXEPOSTFIX): testmemlimit_so.o
$(OBJECTS) tstheap.o dumatest.o thread-test.o testmt.o dumatestpp.o: duma.h
-ifeq ($(OS), windows_nt)
- # do nothing
-else
+#ifeq ($(OS), windows_nt)
+# # do nothing
+#else
ifeq ($(OS), darwin)
$(DUMASO): duma_config.h verinfo.h $(SO_OBJECTS)
@@ -611,8 +612,8 @@ $(DUMASO): duma_config.h verinfo.h $(SO_OBJECTS)
# $(CXX) -g -shared -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc
endif
-
-endif
+#
+#endif
#
# define rules how to build objects for createconf
Build log is like this:
$ make -f ./GNUmakefile OS=$(echo "$OS" | tr '[:upper:]' '[:lower:]' 2>/dev/null || true) OSTYPE=cygwin
using settings for OS=Windows_NT, OSTYPE=cygwin
using default prefix [/usr]
using default srcdir [.]
using default exec_prefix [/usr]
./make_git_source_version.sh > ./verinfo.h
c++ -g -O0 -DWIN32 -Wall -Wextra -std=gnu++11 -c dumapp.cpp -o dumapp.o
dumapp.cpp: In function ‘void* duma_new_operator(std::size_t, _DUMA_Allocator, bool, const char*, int)’:
dumapp.cpp:166:29: warning: catching polymorphic type ‘class std::bad_alloc’ by value [-Wcatch-value=]
166 | catch (std::bad_alloc) // error occured in new_handler
| ^~~~~~~~~
cc -g -O0 -DWIN32 -Wall -Wextra -c duma.c -o duma.o
cc -g -O0 -DWIN32 -Wall -Wextra -c sem_inc.c -o sem_inc.o
cc -g -O0 -DWIN32 -Wall -Wextra -c print.c -o print.o
print.c: In function ‘DUMA_Abort’:
print.c:278:13: warning: variable ‘lenb’ set but not used [-Wunused-but-set-variable]
278 | int lena, lenb;
| ^~~~
print.c: In function ‘DUMA_Exit’:
print.c:363:13: warning: variable ‘lenb’ set but not used [-Wunused-but-set-variable]
363 | int lena, lenb;
| ^~~~
rm -f libduma.a
ar crv libduma.a dumapp.o duma.o sem_inc.o print.o
a - dumapp.o
a - duma.o
a - sem_inc.o
a - print.o
ranlib libduma.a
c++ -g -O0 -DWIN32 -Wall -Wextra -std=gnu++11 -fPIC -DPIC -DDUMA_SO_LIBRARY -c dumapp.cpp -o dumapp_so.o
dumapp.cpp: In function ‘void* duma_new_operator(std::size_t, _DUMA_Allocator, bool)’:
dumapp.cpp:166:29: warning: catching polymorphic type ‘class std::bad_alloc’ by value [-Wcatch-value=]
166 | catch (std::bad_alloc) // error occured in new_handler
| ^~~~~~~~~
cc -g -O0 -DWIN32 -Wall -Wextra -fPIC -DPIC -DDUMA_SO_LIBRARY -c duma.c -o duma_so.o
duma.c:141:19: warning: ‘unknown_file’ defined but not used [-Wunused-const-variable=]
141 | static const char unknown_file[] =
| ^~~~~~~~~~~~
cc -g -O0 -DWIN32 -Wall -Wextra -fPIC -DPIC -DDUMA_SO_LIBRARY -c sem_inc.c -o sem_inc_so.o
cc -g -O0 -DWIN32 -Wall -Wextra -fPIC -DPIC -DDUMA_SO_LIBRARY -c print.c -o print_so.o
print.c: In function ‘DUMA_Abort’:
print.c:278:13: warning: variable ‘lenb’ set but not used [-Wunused-but-set-variable]
278 | int lena, lenb;
| ^~~~
print.c: In function ‘DUMA_Exit’:
print.c:363:13: warning: variable ‘lenb’ set but not used [-Wunused-but-set-variable]
363 | int lena, lenb;
| ^~~~
c++ -g -shared -Wl,-soname,libduma.dll -o libduma.dll dumapp_so.o duma_so.o sem_inc_so.o print_so.o -lpthread -lc
cc -g -O0 -DWIN32 -Wall -Wextra -fPIC -DPIC -DDUMA_SO_LIBRARY -c tests/tstheap.c -o tstheap_so.o
rm -f tstheap_so.exe
cc -g -O0 -DWIN32 -Wall -Wextra tstheap_so.o -o tstheap_so.exe
c++ -g -O0 -DWIN32 -Wall -Wextra -std=gnu++11 -fPIC -DPIC -DDUMA_SO_LIBRARY -c tests/dumatestpp.cpp -o dumatestpp_so.o
rm -f dumatestpp_so.exe
c++ -g -O0 -DWIN32 -Wall -Wextra -std=gnu++11 dumatestpp_so.o -o dumatestpp_so.exe
Build complete - you can now run make test.
... and running make check
basically just outputs this as extra at end:
DUMA static confidence test PASSED.
.
Testing DUMA (dynamic library).
(export LD_PRELOAD=./libduma.dll; export DYLD_INSERT_LIBRARIES=./libduma.dll; export DYLD_FORCE_FLAT_NAMESPACE=1 ; exec ./tstheap_so 3072)
DUMA 2.5.21-0-ge214a6e-dirty, built 10/11/21 09:17:01 (shared library, NO_LEAKDETECTION)
Copyright (C) 2006 Michael Eddington <[email protected]>
Copyright (C) 2002-2009 Hayati Ayguen <[email protected]>, Procitec GmbH
Copyright (C) 1987-1999 Bruce Perens <[email protected]>
.
DUMA dynamic confidence test PASSED.
.
You may now run make install and then installcheck
.
from duma.
Thank you for the report.
As you can obviously tell, I've not tried to use DUMA on Cygwin recently (that is, in many years), and not since changes were made to the Makefiles, hence the issues you had. I apologize for that, and I'll get your Cygwin-related Makefile fixes integrated into master sometime this week.
I've installed the current Cygwin release in Windows 11 in a virtual machine here, and I'll be testing it this week.
I recall there was some issue using the dynamic library as well, but your confidence test passing above seems to indicate that's also outdated. I'll do a few other tests but I think this default is also safe to change.
As far as I can tell, there aren't any "old" Cygwin versions easily available - the Cygwin installer is a network installer that installs the most recent software, in the style of a "rolling" distribution -- while that makes things a little tough to pin down and to document, such as when something started working, it also means there isn't any major concerns about backwards (in)compatibilities.
About the C++ warning - it is, for now, just warning and should have no effect on your use of DUMA at this time. I'm aware of it and will probably have to make changes in the future, but I've avoided making major and possibly breaking changes that aren't strictly necessary, at least for now. We have enough "churn" that I don't want to introduce it into my debugging tools unnecessarily.
A quick test on Windows shows another minor but annoying bug - the version information script doesn't like to run from a directory that contains spaces, so I'll fix that too.
Have you tried using the CMake build system on Cygwin? If you have (or you get to it before I do), please advise me of the experience.
from duma.
Thanks for the response, @johnsonjh - great to have a status on how thing are!
As far as I can tell, there aren't any "old" Cygwin versions easily available - the Cygwin installer is a network installer that installs the most recent software, in the style of a "rolling" distribution
Yeah, that is my experience as well...
while that makes things a little tough to pin down and to document, such as when something started working, it also means there isn't any major concerns about backwards (in)compatibilities.
Agreed!
About the C++ warning - it is, for now, just warning and should have no effect on your use of DUMA at this time.
Good - thanks for confirming!
Have you tried using the CMake build system on Cygwin? If you have (or you get to it before I do), please advise me of the experience.
No I haven't - I'm not much of a CMake guy, so I only use it when instructions tell me I have to :) So unfortunately, I will not be able to report back on the experience...
Thanks again for the response!
from duma.
Just got a working Cygwin configuration up.
Just to update you, looks like some extra adjustments will need to be done to get current Cygwin working in master, and have it work the same way in both Cmake and GNU Make.
If your local changes above are sufficient for you, they should work sufficiently for now.
from duma.
Related Issues (20)
- Many tests fail on FreeBSD HOT 9
- Need documentation for use on Ubuntu and others with compilers that default to -D_FORTIFY_SOURCE=2
- Public signing key HOT 1
- What does DUMA_FAIL_ENV mean? HOT 1
- Test fails on GNU Hurd HOT 8
- Build unreproducible on armhf HOT 3
- CXX Standard HOT 2
- Specifying a CMake toolchain file prevented host/createconf from being created HOT 1
- error C2036: “const void *”: unknown size in pointer arithmetic HOT 1
- Stacktrace library will not compile
- Add /MT to MSVC when compiling shared library HOT 2
- What is DUMA_SO/LIB and is it an error? HOT 1
- Preprocessor defines will not pass to createconf
- testalloc0.cpp crashes HOT 1
- Duration of tstheap
- C11 aligned_alloc() not supported
- Not working with Cygwin on Windows HOT 1
- Reproducible build issue (use of 'date') HOT 4
- Local compiler flags ignored
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from duma.