Re: linking problems

2019-12-08 Thread Werner LEMBERG


> Probably the problem is that you have specified CXX=clang-mp-9.0 --
> that's a C compiler.  You want the C++ compiler here:
> CXX=clang++-mp-9.0

Doh.  That's it.  I was blind.  Fortunately I did first ask here
before investing hours into delving this non-issue.

Thanks a lot!


Werner


Re: linking problems

2019-12-08 Thread Ryan Schmidt
On Dec 8, 2019, at 18:32, Werner LEMBERG wrote:
> 
> On my Mac Lion box running an up-to-date MacPorts, for experimentation
> reasons I try to build the current git version of lilypond directly
> from the repository – this is, I use the MacPorts infrastructure for
> compilation with a recent clang version, but without any adaptations
> of lilypond's source code.
> 
> Building in a separate directory I configure with
> 
>  /path/to/lilypond/git/configure \
>  CC=clang-mp-9.0 \
>  CXX=clang-mp-9.0 \
>  --prefix=... \
>  
> --with-texgyre-dir="/usr/local/texlive/2018/texmf-dist/fonts/opentype/public/tex-gyre"
>  \
>  --with-flexlexer-dir="/opt/local/include" \
>  --disable-documentation \
>  --disable-optimising
> 
> then calling `make`.  However, this fails at the linking stage; I get
> zillion of messages like
> 
>  Undefined symbols for architecture x86_64:
>"std::__1::basic_string
> std::__1::char_traits,
>   std::__1::allocator >::copy
> (char*,
>  unsigned long,
>  unsigned long) const", referenced from:
>  ly_format(scm_unused_struct*, scm_unused_struct*)
>in general-scheme.o
> 
> I guess I miss some linker flags due to the need of a special C++
> library.
> 
> * Which linker flags do I miss?
> 
> * Why doesn't the above invocation of the `configure` script
>  automatically handle this?  Or to ask differently, why doesn't
>  `clang-mp-9.0` find its own library files automatically (at least I
>  presume this is the problem)?

Since MacPorts 2.6.0 we switched to libc++ as our default c++ stdlib.

If you use Xcode clang or an older MacPorts clang, it doesn't know about that, 
so you have to tell it by putting "-stdlib=libc++" in CXXFLAGS. Depending on 
the build system, you may also need to put it in LDFLAGS or make other 
adjustments to get the flags passed in to every command that needs it.

If you use a recent MacPorts clang compiler, it should automatically use libc++.

Probably the problem is that you have specified CXX=clang-mp-9.0 -- that's a C 
compiler. You want the C++ compiler here: CXX=clang++-mp-9.0



linking problems

2019-12-08 Thread Werner LEMBERG

On my Mac Lion box running an up-to-date MacPorts, for experimentation
reasons I try to build the current git version of lilypond directly
from the repository – this is, I use the MacPorts infrastructure for
compilation with a recent clang version, but without any adaptations
of lilypond's source code.

Building in a separate directory I configure with

  /path/to/lilypond/git/configure \
  CC=clang-mp-9.0 \
  CXX=clang-mp-9.0 \
  --prefix=... \
  
--with-texgyre-dir="/usr/local/texlive/2018/texmf-dist/fonts/opentype/public/tex-gyre"
 \
  --with-flexlexer-dir="/opt/local/include" \
  --disable-documentation \
  --disable-optimising

then calling `make`.  However, this fails at the linking stage; I get
zillion of messages like

  Undefined symbols for architecture x86_64:
"std::__1::basic_string
  ,
   std::__1::allocator >::copy
 (char*,
  unsigned long,
  unsigned long) const", referenced from:
  ly_format(scm_unused_struct*, scm_unused_struct*)
in general-scheme.o

I guess I miss some linker flags due to the need of a special C++
library.

* Which linker flags do I miss?

* Why doesn't the above invocation of the `configure` script
  automatically handle this?  Or to ask differently, why doesn't
  `clang-mp-9.0` find its own library files automatically (at least I
  presume this is the problem)?


Werner