Skip to content

more rigorous compiler checks #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

rinkevichjm
Copy link

limits checks to darwin

and C++ tr1 or C++11 headers
fixes to remove extraneous paths in some ruby builds to non system paths
adds C++tr1 versus C++11 header changes
recomment header makefile section
get flags
no more ad hoc checks, use pkg_config
fixed flags to update properly from pkg_config
unneeded edit file
remove $LIBS, mkmf uses $libs (scons uses $LIBS)
remove pig-config updates to $CFLAGS and $LIBS
note: Ruby docs of pkg_config source code show $CXXFLAGS updated, but
actual source doesn’t do it.
use it to replace to code sections and remove duplicate tests
replaced by function definition
more rigorous testing of compilers
remove
@Hanmac
Copy link
Owner

Hanmac commented Jun 2, 2015

i will not add have_std_header because my code doesnt need checks for c+11
same why $CFLAGS += " -std=c++11 -stdlib=libc++ -nostdinc++" will not added

pkg_conf will also not added because i already had the correct fix for that, that you did broke with your replacement

find_executable is also not needed because currently i only check the name,
checking the version too is currently not needed.

i enable travis checks for osx too, if i can get my trunk build and tested in osx than the check for the compiler version will not be added.

@rinkevichjm
Copy link
Author

The wx header code does and you are referencing it. I can't complete the tests let alone compile without those.

Sent from my iPhone

On Jun 1, 2015, at 10:21 PM, Hans Mackowiak [email protected] wrote:

i will not add have_std_header because my code doesnt need checks for c+11
same why $CFLAGS += " -std=c++11 -stdlib=libc++ -nostdinc++" will not added

pkg_conf will also not added because i already had the correct fix for that, that you did broke with your replacement

find_executable is also not needed because currently i only check the name,
checking the version too is currently not needed.

i enable travis checks for osx too, if i can get my trunk build and tested in osx than the check for the compiler version will not be added.


Reply to this email directly or view it on GitHub.

@Hanmac
Copy link
Owner

Hanmac commented Jun 2, 2015

like i said in the other ticket before, update your software (newer gcc or newer clang) and then recompile ruby and wxwidgets again

wxwidgets should not use any c+11 features if your compiler wouldnt already support them, and even then they should not be enabled ...

didnt that all begin because you tryed to activate c++11 for rwx?
if you hadnt done that, it wouldnt be a problem

@rinkevichjm
Copy link
Author

My software is up to date. Test your stuff with clang not just gcc

Sent from my iPhone

On Jun 1, 2015, at 11:05 PM, Hans Mackowiak [email protected] wrote:

like i said in the other ticket before, update your software (newer gcc or newer clang) and then recompile ruby and wxwidgets again

wxwidgets should not use any c+11 features if your compiler wouldnt already support them, and even then they should not be enabled ...

didnt that all begin because you tryed to activate c++11 for rwx?
if you hadnt done that, it wouldnt be a problem


Reply to this email directly or view it on GitHub.

@rinkevichjm
Copy link
Author

Also it is you who are out of date libc++ has replaced libstdc++ with clang and doesn't support those tr1 files only the c++ 11 files headers. TR1 is an optional addendum to C++98. My wxwidgets are built with that libc++ and that is the default on all OSX since 10.6 sdks.

Sent from my iPhone

On Jun 1, 2015, at 11:05 PM, Hans Mackowiak [email protected] wrote:

like i said in the other ticket before, update your software (newer gcc or newer clang) and then recompile ruby and wxwidgets again

wxwidgets should not use any c+11 features if your compiler wouldnt already support them, and even then they should not be enabled ...

didnt that all begin because you tryed to activate c++11 for rwx?
if you hadnt done that, it wouldnt be a problem


Reply to this email directly or view it on GitHub.

@Hanmac
Copy link
Owner

Hanmac commented Jun 2, 2015

i currently cant test it on OSX now, but i tested it local on my machine and it did work with clang too (it did show warnings but thats ok)

like i said your problem is that you might have the wrong version of clang or gcc (did you try to update them to like i said with macports or brew?)

@rinkevichjm
Copy link
Author

The problem is that you aren't using libc++ with clang which is the default under BSDs like Darwin and FreeBSD in Linux you need to add -stdlib=c++
See
https://solarianprogrammer.com/2013/01/17/building-clang-libcpp-ubuntu-linux/
Sent from my iPhone

On Jun 2, 2015, at 12:42 AM, Hans Mackowiak [email protected] wrote:

i currently cant test it on OSX now, but i tested it local on my machine and it did work with clang too (it did show warnings but thats ok)

like i said your problem is that you might have the wrong version of clang or gcc (did you try to update them to like i said with macports or brew?)


Reply to this email directly or view it on GitHub.

@Hanmac
Copy link
Owner

Hanmac commented Jun 2, 2015

what is your clang version wxwidgets is build against?
if its some hidden gcc42 then its a broken version (it was still broken the last time i checked)

what is your version of clang, gcc, wxwidgets and ruby?
is wxwidgets and ruby build against the same compiler as i said? and that clang == gcc42 does not count

did you use brew or macports as i said to install newer versions?

@rinkevichjm
Copy link
Author

l

Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)

Target: x86_64-apple-darwin14.3.0

Thread model: posix

which is the absolute latest version. and it has the latest libc++ which it
uses.

and this isthe mkmf.log when those are removed

have_macro: checking for wxHAS_EVENT_BIND in wx/wx.h...
-------------------- no

"gcc
-I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0
-I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward
-I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I.
-D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
-I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0
-I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__
-D__WXOSX__ -D__WXOSX_COCOA__ -fvisibility-inlines-hidden -g -x c++ -x
c++ -arch x86_64 -c conftest.c"

In file included from conftest.c:3:

In file included from /usr/local/include/wx-3.0/wx/wx.h:15:

In file included from /usr/local/include/wx-3.0/wx/object.h:19:

In file included from /usr/local/include/wx-3.0/wx/memory.h:15:

In file included from /usr/local/include/wx-3.0/wx/string.h:46:

/usr/local/include/wx-3.0/wx/strvararg.h:30:18: fatal error:
'tr1/type_traits' file not found

    #include <tr1/type_traits>

             ^

1 error generated.

checked program was:

/* begin */

1: #include "ruby.h"

2:

3: #include <wx/wx.h>

4: /top/

5: #ifndef wxHAS_EVENT_BIND

6: # error

7: |:/ === wxHAS_EVENT_BIND undefined === /:|

8: #endif

/* end */


On Tue, Jun 2, 2015 at 1:09 PM, Hans Mackowiak [email protected]
wrote:

what is your clang version wxwidgets is build against?
if its some hidden gcc42 then its a broken version (it was still broken
the last time i checked)

what is your version of clang, gcc, wxwidgets and ruby?
is wxwidgets and ruby build against the same compiler as i said? and that
clang == gcc42 does not count

did you use brew or macports as i said to install newer versions?


Reply to this email directly or view it on GitHub
#13 (comment).

@Hanmac
Copy link
Owner

Hanmac commented Jun 3, 2015

your ruby seems still be build against gcc then clang
try to install a clang version with rvm using --clang while installing the ruby version

@rinkevichjm
Copy link
Author

The problem is that the stdc++ library headers used by gcc5.1 look like this
algorithm array atomic backward/ bits/ bitset cassert ccomplex cctype cerrno
cfenv cfloat chrono cinttypes ciso646 climits clocale cmath codecvt complex
complex.h condition_variable csetjmp csignal cstdalign cstdarg cstdbool
cstddef
cstdint cstdio cstdlib cstring ctgmath ctime cwchar cwctype cxxabi.h debug/
decimal/ deque exception experimental/ ext/ fenv.h forward_list fstream
functional
future initializer_list iomanip ios iosfwd iostream istream iterator limits
list locale
map memory mutex new numeric ostream parallel/ profile/ queue random ratio
regex scoped_allocator set shared_mutex sstream stack stdexcept streambuf
string system_error tgmath.h thread tr1/ tr2/ tuple type_traits typeindex
typeinfo
unordered_map unordered_set utility valarray vector

x86_64-apple-darwin14.3.0/

note that tr1 is a folder and contains
array bessel_function.tcc beta_function.tcc ccomplex cctype cfenv cfloat
cinttypes
climits cmath complex complex.h cstdarg cstdbool cstdint cstdio cstdlib
ctgmath
ctime ctype.h cwchar cwctype ell_integral.tcc exp_integral.tcc fenv.h
float.h
functional functional_hash.h gamma.tcc hashtable.h hashtable_policy.h
hypergeometric.tcc inttypes.h legendre_function.tcc limits.h math.h memory
modified_bessel_func.tcc poly_hermite.tcc poly_laguerre.tcc random random.h
random.tcc regex riemann_zeta.tcc shared_ptr.h special_function_util.h
stdarg.h
stdbool.h stdint.h stdio.h stdlib.h tgmath.h tuple type_traits unordered_map

unordered_map.h unordered_set unordered_set.h utility wchar.h wctype.h

but libc++ library header contains
__bit_reference __config __debug __functional_03 __functional_base
__functional_base_03
__hash_table __locale __mutex_base __refstring __split_buffer
__sso_allocator
__std_stream __tree __tuple __tuple_03 __undef_min_max algorithm array
atomic
bitset cassert ccomplex cctype cerrno cfenv cfloat chrono cinttypes ciso646
climits clocale
cmath codecvt complex complex.h condition_variable csetjmp csignal cstdarg
cstdbool cstddef
cstdint cstdio cstdlib cstring ctgmath ctime cwchar cwctype deque exception
experimental/ ext/
forward_list fstream functional future initializer_list iomanip ios iosfwd
iostream istream iterator
limits list locale map memory module.modulemap mutex new numeric ostream
queue random
ratio regex scoped_allocator set shared_mutex sstream stack stdexcept
streambuf string
strstream system_error tgmath.h thread tuple type_traits typeindex typeinfo
unordered_map

unordered_set utility valarray vector

Note the absence of tr1 headers

On Tue, Jun 2, 2015 at 8:00 PM, Hans Mackowiak [email protected]
wrote:

your ruby seems still be build against gcc then clang
try to install a clang version with rvm using --clang while installing the
ruby version


Reply to this email directly or view it on GitHub
#13 (comment).

@Hanmac
Copy link
Owner

Hanmac commented Jun 3, 2015

the problem is more that it might try to find the wrong folder
then maybe the detection in wx is broken but not in my program
is your ruby really build against clang?

what does RbConfig::CONFIG["CC"] return in your ruby?

as i said before build a new ruby with rvm with adding --clang as parameter so it only builds against clang and not gcc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants