Re: [CMake] [FYI] clang-3.4 vs cmake-3.11.0 (How to build CMake so it works on an older Linux?)

2018-04-05 Thread suzuki toshiya
Dear Marcel,

Oh, I slipped to remind the exist of launchpad... Thanks!
at least, gcc-6.2.0 seems to be available for 12.04.

Regards,
mpsuzuki

Marcel Loose wrote:
> Hi Suzuki,
> 
> Sorry for chiming in late, but you may want to try the PPA for Ubuntu
> Toolchain test builds, which contains compiler builds up to gcc-8 for
> Ubuntu version as old as 10.04. Much less of a hassle than building GCC
> yourself, I can tell from experience. Check out
> https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
> 
> Cheers,
> Marcel.
> 
> 
> On 05/04/18 07:29, suzuki toshiya wrote:
>> Sorry for bothering subscribers for posting about C++11 environment
>> instead of cmake itself. Now I understand building gcc >= 4.8.5
>> manually might be easier, in comparison with the quest of libc++
>> for clang-3.4.
>>
>> https://stackoverflow.com/questions/39332406/install-libc-on-ubuntu
>>
>> Regards,
>> mpsuzuki
>>
>> suzuki toshiya wrote:
>>> Dear Bo Zhou,
>>>
>>> Sorry, I've confirmed by myself.
>>> By default, clang-3.4 for Ubuntu prioritizes old g++ header files, and clang
>>> header files are searched as a fallback.
>>> I can customize the searching order by -nostdinc++...
>>>
>>> Regards,
>>> mpsuzuki
>>>
>>> suzuki toshiya wrote:
>>>> Dear Bo Zhou,
>>>>
>>>> Thank you for prompt reply.
>>>>
>>>>> Be aware that GCC suite actually is independent from the libstdc++, so if 
>>>>> you have a newer compiler, the compiler might still pick the older 
>>>>> libstdc++ without the new API.
>>>> Oh, so, even if I installed clang-3.4, still it uses older (maybe C++03)
>>>> libraries are referred by it?
>>>>
>>>> Regards,
>>>> mpsuzuki
>>>>
>>>> Bo Zhou wrote:
>>>>> The emplace() is new API from C++11.
>>>>>
>>>>> Be aware that GCC suite actually is independent from the libstdc++, so if 
>>>>> you have a newer compiler, the compiler might still pick the older 
>>>>> libstdc++ without the new API.
>>>>>
>>>>> This issue doesn't exist at Windows, since Visual Studio is a complete 
>>>>> sytem.
>>>>>
>>>>> This issue happens on OSX also, so user must give the compiler a proper 
>>>>> MacOS SDK for the new header files etc.
>>>>>
>>>>> On Thu, Apr 5, 2018 at 1:33 PM, suzuki toshiya 
>>>>> mailto:mpsuz...@hiroshima-u.ac.jp>> wrote:
>>>>> $ clang++ --version
>>>>> Ubuntu clang version 3.4-1ubuntu3~precise2 (tags/RELEASE_34/final) (based 
>>>>> on
>>>>> LLVM 3.4)
>>>>> Target: x86_64-pc-linux-gnu
>>>>> Thread model: posix
>>>>>
>>>>> But I got following abort:
>>>>>
>>>>> cmake-3.11.0/Source/cmLocalGenerator.cxx:553:36: error: no member named 
>>>>> 'emplace' in
>>>>>   'std::unordered_map, cmGeneratorTarget *,
>>>>> std::hash, std::equal_to >,
>>>>>   std::allocator, 
>>>>> cmGeneratorTarget
>>>>> *> > >'
>>>>>   this->GeneratorTargetSearchIndex.emplace(gt->GetName(), gt);
>>>>>    ^
>>>>>
>>>>> G X-D
>>>>>
>>>>> Regards,
>>>>> mpsuzuki
>>>>>
>>>>> suzuki toshiya wrote:
>>>>>> Dear Bo Zhou,
>>>>>>
>>>>>> Thank you for the info! Now I'm checking Ubuntu 12.04 in LXC.
>>>>>> So, gcc-4.8.5 or later would be needed for C++11, it seems that the last 
>>>>>> version
>>>>>> of gcc officially provided for Ubuntu-12 was 4.7. oh.
>>>>>> According to https://clang.llvm.org/cxx_status.html , clang-3.3 supports 
>>>>>> C++11,
>>>>>> and the last version of clang officially provided for Ubuntu-12 was 3.4. 
>>>>>> ooh.
>>>>>> I will check if clang-3.4 for Ubuntu-12.04 can compile cmake (or any 
>>>>>> other
>>>>>> dependency problems would arise).
>>>>>>
>>>>>>> Usually the ABI is not the problem but the libstdc++, you can use a old 
>>>>>>> Ubuntu with old libstdc++ but build CMake with new compiler an

Re: [CMake] How to build CMake so it works on an older Linux?

2018-04-05 Thread suzuki toshiya
Dear Eric,

# if anybody think "how C++11 environment should be prepared
# on legacy GNU/Linux" is off-topic and should be discussed
# in off-list, please let me know. I will do so.

Eric Wing wrote:
> Thanks for the responses. Yes, I just need this to run on Ubuntu 12.04
> (and some other old Linux's in that era). Yes, I think the probably is
> the libstdc++ dependency.
> 
> As pointed out, it is really hard to get a newer compiler on Ubuntu
> 12.04. I've been down this road before, and if memory serves, the gcc
> bootstrapping process to get a newer compiler doesn't seem to work
> with a compiler older than gcc 4.8. Same goes for clang, which also
> weirdly relies on gcc 4.8 to bootstrap itself.

At least, gcc-4.6.3, the last official gcc for Ubuntu-12.04, could
build gcc-4.8.5 manually (without shared libstdc++, so confused
dependency could be avoided). And, I could build cmake-3.11.0 by it.
Now I'm checking "make test".

If you can give the preferred prefix to install gcc-4.8.5 + cmake-3.11.0,
I would be able to a tarball of the binaries. but please prepare
some virus + malware checking :-)

Regards,
mpsuzuki

> Anyway, CMake seems to already know how to ship binaries that work
> across Linux distros. I'm pretty sure they just statically linked
> libstdc++ and libgcc. In fact, I just built it with -static-libstdc++
> -static-libgcc on a newer Linux and tested it on 12.04 and it seemed
> to work.
> 
> But I wanted to know for sure how CMake is building their own binaries
> in case there are subtle problems with what I did, and they have a
> completely different way of building it, e.g. statically libmusl for C
> and libc++ for C++, avoiding gcc entirely.
> 
> Also, I did not take care of the libssl, libcrypto, and libz
> dependencies. I'm curious in practice how much trouble these are. (My
> recollection with zlib is that it is extremely stable and they care a
> great deal about not breaking backwards compatibility. I don't know
> about the others.)
> 
> Thanks,
> Eric
> 

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] [FYI] clang-3.4 vs cmake-3.11.0 (How to build CMake so it works on an older Linux?)

2018-04-04 Thread suzuki toshiya
Sorry for bothering subscribers for posting about C++11 environment
instead of cmake itself. Now I understand building gcc >= 4.8.5
manually might be easier, in comparison with the quest of libc++
for clang-3.4.

https://stackoverflow.com/questions/39332406/install-libc-on-ubuntu

Regards,
mpsuzuki

suzuki toshiya wrote:
> Dear Bo Zhou,
> 
> Sorry, I've confirmed by myself.
> By default, clang-3.4 for Ubuntu prioritizes old g++ header files, and clang
> header files are searched as a fallback.
> I can customize the searching order by -nostdinc++...
> 
> Regards,
> mpsuzuki
> 
> suzuki toshiya wrote:
>> Dear Bo Zhou,
>>
>> Thank you for prompt reply.
>>
>>> Be aware that GCC suite actually is independent from the libstdc++, so if 
>>> you have a newer compiler, the compiler might still pick the older 
>>> libstdc++ without the new API.
>> Oh, so, even if I installed clang-3.4, still it uses older (maybe C++03)
>> libraries are referred by it?
>>
>> Regards,
>> mpsuzuki
>>
>> Bo Zhou wrote:
>>> The emplace() is new API from C++11.
>>>
>>> Be aware that GCC suite actually is independent from the libstdc++, so if 
>>> you have a newer compiler, the compiler might still pick the older 
>>> libstdc++ without the new API.
>>>
>>> This issue doesn't exist at Windows, since Visual Studio is a complete 
>>> sytem.
>>>
>>> This issue happens on OSX also, so user must give the compiler a proper 
>>> MacOS SDK for the new header files etc.
>>>
>>> On Thu, Apr 5, 2018 at 1:33 PM, suzuki toshiya 
>>> mailto:mpsuz...@hiroshima-u.ac.jp>> wrote:
>>> $ clang++ --version
>>> Ubuntu clang version 3.4-1ubuntu3~precise2 (tags/RELEASE_34/final) (based on
>>> LLVM 3.4)
>>> Target: x86_64-pc-linux-gnu
>>> Thread model: posix
>>>
>>> But I got following abort:
>>>
>>> cmake-3.11.0/Source/cmLocalGenerator.cxx:553:36: error: no member named 
>>> 'emplace' in
>>>   'std::unordered_map, cmGeneratorTarget *,
>>> std::hash, std::equal_to >,
>>>   std::allocator, 
>>> cmGeneratorTarget
>>> *> > >'
>>>   this->GeneratorTargetSearchIndex.emplace(gt->GetName(), gt);
>>>    ^
>>>
>>> G X-D
>>>
>>> Regards,
>>> mpsuzuki
>>>
>>> suzuki toshiya wrote:
>>>> Dear Bo Zhou,
>>>>
>>>> Thank you for the info! Now I'm checking Ubuntu 12.04 in LXC.
>>>> So, gcc-4.8.5 or later would be needed for C++11, it seems that the last 
>>>> version
>>>> of gcc officially provided for Ubuntu-12 was 4.7. oh.
>>>> According to https://clang.llvm.org/cxx_status.html , clang-3.3 supports 
>>>> C++11,
>>>> and the last version of clang officially provided for Ubuntu-12 was 3.4. 
>>>> ooh.
>>>> I will check if clang-3.4 for Ubuntu-12.04 can compile cmake (or any other
>>>> dependency problems would arise).
>>>>
>>>>> Usually the ABI is not the problem but the libstdc++, you can use a old 
>>>>> Ubuntu with old libstdc++ but build CMake with new compiler and make sure 
>>>>> it links with old libstdc++. This is the trick.
>>>> Indeed.
>>>>
>>>> Regards,
>>>> mpsuzuki
>>>>
>>>> Bo Zhou wrote:
>>>>> The latest CMake requires C++11 compiler, so what you need is just a 
>>>>> newer GCC which supports C++11 at your platform, that's it.
>>>>>
>>>>> Usually the ABI is not the problem but the libstdc++, you can use a old 
>>>>> Ubuntu with old libstdc++ but build CMake with new compiler and make sure 
>>>>> it links with old libstdc++. This is the trick.
>>>>>
>>>>> I don't know how to do this on Ubuntu, but on CentOS, it's possible to 
>>>>> build CMake in that way, so the CMake would be portable at older CentOS 
>>>>> platform with old libstdc++ .
>>>>>
>>>>> Good luck.
>>>>>
>>>>> On Thu, Apr 5, 2018 at 12:23 PM, Eric Wing 
>>>>> mailto:ewmail...@gmail.com><mailto:ewmail...@gmail.com<mailto:ewmail...@gmail.com>>>
>>>>>  wrote:
>>>>> I just discovered that CMake no longer builds on my Ubuntu 12.04. I
>>>>> need to build binaries that are co

Re: [CMake] [FYI] clang-3.4 vs cmake-3.11.0 (How to build CMake so it works on an older Linux?)

2018-04-04 Thread suzuki toshiya
Dear Bo Zhou,

Sorry, I've confirmed by myself.
By default, clang-3.4 for Ubuntu prioritizes old g++ header files, and clang
header files are searched as a fallback.
I can customize the searching order by -nostdinc++...

Regards,
mpsuzuki

suzuki toshiya wrote:
> Dear Bo Zhou,
> 
> Thank you for prompt reply.
> 
>> Be aware that GCC suite actually is independent from the libstdc++, so if 
>> you have a newer compiler, the compiler might still pick the older libstdc++ 
>> without the new API.
> 
> Oh, so, even if I installed clang-3.4, still it uses older (maybe C++03)
> libraries are referred by it?
> 
> Regards,
> mpsuzuki
> 
> Bo Zhou wrote:
>> The emplace() is new API from C++11.
>>
>> Be aware that GCC suite actually is independent from the libstdc++, so if 
>> you have a newer compiler, the compiler might still pick the older libstdc++ 
>> without the new API.
>>
>> This issue doesn't exist at Windows, since Visual Studio is a complete sytem.
>>
>> This issue happens on OSX also, so user must give the compiler a proper 
>> MacOS SDK for the new header files etc.
>>
>> On Thu, Apr 5, 2018 at 1:33 PM, suzuki toshiya 
>> mailto:mpsuz...@hiroshima-u.ac.jp>> wrote:
>> $ clang++ --version
>> Ubuntu clang version 3.4-1ubuntu3~precise2 (tags/RELEASE_34/final) (based on
>> LLVM 3.4)
>> Target: x86_64-pc-linux-gnu
>> Thread model: posix
>>
>> But I got following abort:
>>
>> cmake-3.11.0/Source/cmLocalGenerator.cxx:553:36: error: no member named 
>> 'emplace' in
>>   'std::unordered_map, cmGeneratorTarget *,
>> std::hash, std::equal_to >,
>>   std::allocator, 
>> cmGeneratorTarget
>> *> > >'
>>   this->GeneratorTargetSearchIndex.emplace(gt->GetName(), gt);
>>    ^
>>
>> G X-D
>>
>> Regards,
>> mpsuzuki
>>
>> suzuki toshiya wrote:
>>> Dear Bo Zhou,
>>>
>>> Thank you for the info! Now I'm checking Ubuntu 12.04 in LXC.
>>> So, gcc-4.8.5 or later would be needed for C++11, it seems that the last 
>>> version
>>> of gcc officially provided for Ubuntu-12 was 4.7. oh.
>>> According to https://clang.llvm.org/cxx_status.html , clang-3.3 supports 
>>> C++11,
>>> and the last version of clang officially provided for Ubuntu-12 was 3.4. 
>>> ooh.
>>> I will check if clang-3.4 for Ubuntu-12.04 can compile cmake (or any other
>>> dependency problems would arise).
>>>
>>>> Usually the ABI is not the problem but the libstdc++, you can use a old 
>>>> Ubuntu with old libstdc++ but build CMake with new compiler and make sure 
>>>> it links with old libstdc++. This is the trick.
>>> Indeed.
>>>
>>> Regards,
>>> mpsuzuki
>>>
>>> Bo Zhou wrote:
>>>> The latest CMake requires C++11 compiler, so what you need is just a newer 
>>>> GCC which supports C++11 at your platform, that's it.
>>>>
>>>> Usually the ABI is not the problem but the libstdc++, you can use a old 
>>>> Ubuntu with old libstdc++ but build CMake with new compiler and make sure 
>>>> it links with old libstdc++. This is the trick.
>>>>
>>>> I don't know how to do this on Ubuntu, but on CentOS, it's possible to 
>>>> build CMake in that way, so the CMake would be portable at older CentOS 
>>>> platform with old libstdc++ .
>>>>
>>>> Good luck.
>>>>
>>>> On Thu, Apr 5, 2018 at 12:23 PM, Eric Wing 
>>>> mailto:ewmail...@gmail.com><mailto:ewmail...@gmail.com<mailto:ewmail...@gmail.com>>>
>>>>  wrote:
>>>> I just discovered that CMake no longer builds on my Ubuntu 12.04. I
>>>> need to build binaries that are compatible with that ABI.
>>>>
>>>> I see that your binary distribution of CMake 3.11 still works on
>>>> Ubuntu 12.04. Can you tell me what you do to achieve this? What are
>>>> you doing for your official builds?
>>>>
>>>> Are you just using -static-libstdc++ -static-libgcc for
>>>> CMAKE_CXX_FLAGS, or is there more?
>>>>
>>>> (I just noticed that ldd shows that you don't have dependencies on
>>>> libssl, libcrypto, and libz, whereas I do.)
>>>>
>>>> Thanks,
>>>> Eric
>>>> --
>>>>
>>>> Powered by www.kitware.com<http://www.kitware.com><htt

Re: [CMake] [FYI] clang-3.4 vs cmake-3.11.0 (How to build CMake so it works on an older Linux?)

2018-04-04 Thread suzuki toshiya
Dear Bo Zhou,

Thank you for prompt reply.

> Be aware that GCC suite actually is independent from the libstdc++, so if you 
> have a newer compiler, the compiler might still pick the older libstdc++ 
> without the new API.

Oh, so, even if I installed clang-3.4, still it uses older (maybe C++03)
libraries are referred by it?

Regards,
mpsuzuki

Bo Zhou wrote:
> The emplace() is new API from C++11.
> 
> Be aware that GCC suite actually is independent from the libstdc++, so if you 
> have a newer compiler, the compiler might still pick the older libstdc++ 
> without the new API.
> 
> This issue doesn't exist at Windows, since Visual Studio is a complete sytem.
> 
> This issue happens on OSX also, so user must give the compiler a proper MacOS 
> SDK for the new header files etc.
> 
> On Thu, Apr 5, 2018 at 1:33 PM, suzuki toshiya 
> mailto:mpsuz...@hiroshima-u.ac.jp>> wrote:
> $ clang++ --version
> Ubuntu clang version 3.4-1ubuntu3~precise2 (tags/RELEASE_34/final) (based on
> LLVM 3.4)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
> 
> But I got following abort:
> 
> cmake-3.11.0/Source/cmLocalGenerator.cxx:553:36: error: no member named 
> 'emplace' in
>   'std::unordered_map, cmGeneratorTarget *,
> std::hash, std::equal_to >,
>   std::allocator, 
> cmGeneratorTarget
> *> > >'
>   this->GeneratorTargetSearchIndex.emplace(gt->GetName(), gt);
>    ^
> 
> G X-D
> 
> Regards,
> mpsuzuki
> 
> suzuki toshiya wrote:
>> Dear Bo Zhou,
>>
>> Thank you for the info! Now I'm checking Ubuntu 12.04 in LXC.
>> So, gcc-4.8.5 or later would be needed for C++11, it seems that the last 
>> version
>> of gcc officially provided for Ubuntu-12 was 4.7. oh.
>> According to https://clang.llvm.org/cxx_status.html , clang-3.3 supports 
>> C++11,
>> and the last version of clang officially provided for Ubuntu-12 was 3.4. ooh.
>> I will check if clang-3.4 for Ubuntu-12.04 can compile cmake (or any other
>> dependency problems would arise).
>>
>>> Usually the ABI is not the problem but the libstdc++, you can use a old 
>>> Ubuntu with old libstdc++ but build CMake with new compiler and make sure 
>>> it links with old libstdc++. This is the trick.
>> Indeed.
>>
>> Regards,
>> mpsuzuki
>>
>> Bo Zhou wrote:
>>> The latest CMake requires C++11 compiler, so what you need is just a newer 
>>> GCC which supports C++11 at your platform, that's it.
>>>
>>> Usually the ABI is not the problem but the libstdc++, you can use a old 
>>> Ubuntu with old libstdc++ but build CMake with new compiler and make sure 
>>> it links with old libstdc++. This is the trick.
>>>
>>> I don't know how to do this on Ubuntu, but on CentOS, it's possible to 
>>> build CMake in that way, so the CMake would be portable at older CentOS 
>>> platform with old libstdc++ .
>>>
>>> Good luck.
>>>
>>> On Thu, Apr 5, 2018 at 12:23 PM, Eric Wing 
>>> mailto:ewmail...@gmail.com><mailto:ewmail...@gmail.com<mailto:ewmail...@gmail.com>>>
>>>  wrote:
>>> I just discovered that CMake no longer builds on my Ubuntu 12.04. I
>>> need to build binaries that are compatible with that ABI.
>>>
>>> I see that your binary distribution of CMake 3.11 still works on
>>> Ubuntu 12.04. Can you tell me what you do to achieve this? What are
>>> you doing for your official builds?
>>>
>>> Are you just using -static-libstdc++ -static-libgcc for
>>> CMAKE_CXX_FLAGS, or is there more?
>>>
>>> (I just noticed that ldd shows that you don't have dependencies on
>>> libssl, libcrypto, and libz, whereas I do.)
>>>
>>> Thanks,
>>> Eric
>>> --
>>>
>>> Powered by www.kitware.com<http://www.kitware.com><http://www.kitware.com>
>>>
>>> Please keep messages on-topic and check the CMake FAQ at: 
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Kitware offers various services to support the CMake community. For more 
>>> information on each offering, please visit:
>>>
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>>
>>> Visit other Kitware open-source projects at 
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>>

[CMake] [FYI] clang-3.4 vs cmake-3.11.0 (How to build CMake so it works on an older Linux?)

2018-04-04 Thread suzuki toshiya
$ clang++ --version
Ubuntu clang version 3.4-1ubuntu3~precise2 (tags/RELEASE_34/final) (based on
LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix

But I got following abort:

cmake-3.11.0/Source/cmLocalGenerator.cxx:553:36: error: no member named 
'emplace' in
  'std::unordered_map, cmGeneratorTarget *,
std::hash, std::equal_to >,
  std::allocator, cmGeneratorTarget
*> > >'
  this->GeneratorTargetSearchIndex.emplace(gt->GetName(), gt);
   ^

Grrrr X-D

Regards,
mpsuzuki

suzuki toshiya wrote:
> Dear Bo Zhou,
> 
> Thank you for the info! Now I'm checking Ubuntu 12.04 in LXC.
> So, gcc-4.8.5 or later would be needed for C++11, it seems that the last 
> version
> of gcc officially provided for Ubuntu-12 was 4.7. oh.
> According to https://clang.llvm.org/cxx_status.html , clang-3.3 supports 
> C++11,
> and the last version of clang officially provided for Ubuntu-12 was 3.4. ooh.
> I will check if clang-3.4 for Ubuntu-12.04 can compile cmake (or any other
> dependency problems would arise).
> 
>> Usually the ABI is not the problem but the libstdc++, you can use a old 
>> Ubuntu with old libstdc++ but build CMake with new compiler and make sure it 
>> links with old libstdc++. This is the trick.
> 
> Indeed.
> 
> Regards,
> mpsuzuki
> 
> Bo Zhou wrote:
>> The latest CMake requires C++11 compiler, so what you need is just a newer 
>> GCC which supports C++11 at your platform, that's it.
>>
>> Usually the ABI is not the problem but the libstdc++, you can use a old 
>> Ubuntu with old libstdc++ but build CMake with new compiler and make sure it 
>> links with old libstdc++. This is the trick.
>>
>> I don't know how to do this on Ubuntu, but on CentOS, it's possible to build 
>> CMake in that way, so the CMake would be portable at older CentOS platform 
>> with old libstdc++ .
>>
>> Good luck.
>>
>> On Thu, Apr 5, 2018 at 12:23 PM, Eric Wing 
>> mailto:ewmail...@gmail.com>> wrote:
>> I just discovered that CMake no longer builds on my Ubuntu 12.04. I
>> need to build binaries that are compatible with that ABI.
>>
>> I see that your binary distribution of CMake 3.11 still works on
>> Ubuntu 12.04. Can you tell me what you do to achieve this? What are
>> you doing for your official builds?
>>
>> Are you just using -static-libstdc++ -static-libgcc for
>> CMAKE_CXX_FLAGS, or is there more?
>>
>> (I just noticed that ldd shows that you don't have dependencies on
>> libssl, libcrypto, and libz, whereas I do.)
>>
>> Thanks,
>> Eric
>> --
>>
>> Powered by www.kitware.com<http://www.kitware.com>
>>
>> Please keep messages on-topic and check the CMake FAQ at: 
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more 
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at 
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> https://cmake.org/mailman/listinfo/cmake
>>
>>
>>
> 

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] How to build CMake so it works on an older Linux?

2018-04-04 Thread suzuki toshiya
Dear Bo Zhou,

Thank you for the info! Now I'm checking Ubuntu 12.04 in LXC.
So, gcc-4.8.5 or later would be needed for C++11, it seems that the last version
of gcc officially provided for Ubuntu-12 was 4.7. oh.
According to https://clang.llvm.org/cxx_status.html , clang-3.3 supports C++11,
and the last version of clang officially provided for Ubuntu-12 was 3.4. ooh.
I will check if clang-3.4 for Ubuntu-12.04 can compile cmake (or any other
dependency problems would arise).

> Usually the ABI is not the problem but the libstdc++, you can use a old 
> Ubuntu with old libstdc++ but build CMake with new compiler and make sure it 
> links with old libstdc++. This is the trick.

Indeed.

Regards,
mpsuzuki

Bo Zhou wrote:
> The latest CMake requires C++11 compiler, so what you need is just a newer 
> GCC which supports C++11 at your platform, that's it.
> 
> Usually the ABI is not the problem but the libstdc++, you can use a old 
> Ubuntu with old libstdc++ but build CMake with new compiler and make sure it 
> links with old libstdc++. This is the trick.
> 
> I don't know how to do this on Ubuntu, but on CentOS, it's possible to build 
> CMake in that way, so the CMake would be portable at older CentOS platform 
> with old libstdc++ .
> 
> Good luck.
> 
> On Thu, Apr 5, 2018 at 12:23 PM, Eric Wing 
> mailto:ewmail...@gmail.com>> wrote:
> I just discovered that CMake no longer builds on my Ubuntu 12.04. I
> need to build binaries that are compatible with that ABI.
> 
> I see that your binary distribution of CMake 3.11 still works on
> Ubuntu 12.04. Can you tell me what you do to achieve this? What are
> you doing for your official builds?
> 
> Are you just using -static-libstdc++ -static-libgcc for
> CMAKE_CXX_FLAGS, or is there more?
> 
> (I just noticed that ldd shows that you don't have dependencies on
> libssl, libcrypto, and libz, whereas I do.)
> 
> Thanks,
> Eric
> --
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
> 
> 
> 

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] looking for 2 features to help pkg-config pc files

2018-03-29 Thread suzuki toshiya

Dear Paul Fultz,

Great, I will take a look.
I'm glad to hear that you're also working on this issue!

Regards,
mpsuzuki

On 3/30/2018 9:08 AM, P F wrote:

The BCM(boost cmake modules) has `bcm_auto_pkgconfig` which will generate the 
pkgconfig file from a target, including the “Require” variable:

http://bcm.readthedocs.io/en/latest/src/BCMPkgConfig.html#bcm-auto-pkgconfig

It utilizes the `INTERFACE_PKG_CONFIG_NAME` property to generate the pkgconfig 
names for the dependent targets:

http://bcm.readthedocs.io/en/latest/src/BCMProperties.html#interface-pkg-config-name

Currently, it doesn't coordinate with FindPkgConfig’s imported targets yet, so 
you will need to manually inject the name. However, when using 
`bcm_auto_export` it will export the property, so that when users finds the 
dependency with `find_package`, it knows the corresponding pkgconfig module.

On Mar 27, 2018, at 7:19 AM, suzuki toshiya 
mailto:mpsuz...@hiroshima-u.ac.jp>> wrote:

Hi all,

I'm looking for 2 features to generate pkg-config pc files.
I already wrote something, but some experts advised that there
would be many people trying to do such, and there might be existing
solution. If such functions are already included in cmake's
official modules, please let me know. Of course, combination
of existing functions would be OK.

function 1)
---

...is trying to find an available pkg-config module name from a
list of several candidates. the typical usecase would be a
search of libjpeg by pkg-config (libjpeg? libjpeg8? libjpeg8-turbo?
libjpeg9? libjpeg62? ...). getting a name of module is important
to write "Require" variable of pc file.

there is already pkg_search_module() searching an available module
from a list, but it does not return the name of found module.
thus it cannot help to write "Require" variable.

what I wrote is something like this.

#
# PKG_SEARCH_AVAILABLE_MODULE([var-name-of-found-module] [modules])
#
# there is pkg_search_module(), but it does not clarify
# which module was found.
#
# this function does not set xxx_CFLAGS xxx_LIBS etc.
#
# use like:
# PKG_SEARCH_AVAILABLE_MODULE(PC_LIBJPEG
"libjpeg;libjpeg8-turbo;libjpeg8;libjpeg9;libjpeg62")
#
function(PKG_SEARCH_AVAILABLE_MODULE _found_pkg pkg_list)
  set(_PKG_FOUND FALSE)
  foreach(_pkg IN LISTS pkg_list)
pkg_check_modules(_PKG "${_pkg}")
if (_PKG_FOUND)
  set("${_found_pkg}_FOUND" TRUE PARENT_SCOPE)
  set("${_found_pkg}_MODULE_NAME" "${_pkg}" PARENT_SCOPE)
  return()
endif()
  endforeach(_pkg)
endfunction(PKG_SEARCH_AVAILABLE_MODULE)

function 2)
---
...makes something like LDFLAGS + LIBS from the pathnames of libraries.
some library finders of cmake do not return "-L/xxx -lyyy" values
but returns "/xxx/libyyy.so". pkg-config has some difficulties
to hold such raw pathnames of the libraries (e.g. pkg-config
use "Libs" variable for both of static and shared linking,
thus having "libxxx.a" or "libxxx.so" explicitly is not good),
so, the translation from "/xxx/libyyy.so" to "-L/xxx -lyyy".

what I wrote is something like this:

#
# MAKE_LDFLAGS_FROM_LIBPATH([var-ldflags+libs] [libpath])
#
function(MAKE_LDFLAGS_FROM_LIBPATHS _ldflags _libpaths)
  foreach(_libpath IN LISTS _libpaths)
string(REGEX REPLACE "/[^/]*$" "" _libdir "${_libpath}")

string(REGEX REPLACE "^.*/" "" _lib "${_libpath}")
string(REGEX REPLACE
"(\\${CMAKE_STATIC_LIBRARY_SUFFIX}|\\${CMAKE_SHARED_LIBRARY_SUFFIX})$" "" _lib
"${_lib}")
string(REGEX REPLACE "^lib" "" _lib "${_lib}")

set(__ldflags "${__ldflags} ${CMAKE_LIBRARY_PATH_FLAG}${_libdir}
${CMAKE_LINK_LIBRARY_FLAG}${_lib}")
  endforeach(_libpath)
  set("${_ldflags}" "${__ldflags}" PARENT_SCOPE)
endfunction(MAKE_LDFLAGS_FROM_LIBPATH)

Regards,
mpsuzuki

--

Powered by www.kitware.com<http://www.kitware.com/>

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake




--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] looking for 2 features to help pkg-config pc files

2018-03-27 Thread suzuki toshiya
Dear Nikos,

Thank you for concrete suggestion!

Nikos Chantziaras wrote:
> Is there a reason why you can't generate your .pc file from a .pc.in 
> file using the configure_file() function?

Yes, that's what I'm doing now :-)

https://github.com/mpsuzuki/poppler/compare/5e7aef9d...52ec0ec8#diff-af3b638bc2a3e6c650974192a53c7291

>Requires: @PKGCONF_REQ_PUB@
>Requires.private: @PKGCONF_REQ_PRIV@

>Libs.private: -L"${libdir}" -lmylibrary @PKGCONF_LIBS_PRIV@

Here here. The functions I'm looking for is the helper
functions to construct @PKGCONF_REQ_PUB@, @PKGCONF_REQ_PRIV@,
and @PKGCONF_LIBS_PRIV@.

> You then set the PKGCONF_* variables in your cmake file. This is what I 
> use in a project of mine. You can use it as an example:
> 
>https://github.com/realnc/SDL_audiolib/blob/master/CMakeLists.txt

Also thanks for concrete example. It seems that you have already
spot the appropriate pkg-config module name to be written in pc
file (so you could hardcode the name of the module). My problem
is that sometimes the appropriate pkg-config module name is unclear,
because some package finders in cmake do not invoke pkg-config
at all, or, even if pkg-config is invoked, some package finders do
not return the names of found modules.

--

Reading other (kind) suggestions to me, it seems that the majority
of cmake users think "retrieving the info from pkg-config is still
practical in some cases, but providing the info to pkg-config is not
practical anymore". that's ok, it answers my question "why I cannot
find these functions?", the answer was simple "because few people
wanted such". Sincerely I thank to everybody answered to my question.

Regards,
mpsuzuki



> On 27/03/18 19:10, suzuki toshiya wrote:
>> Dear Craig,
>>
>> Thank you for prompt reply. But all 3 functions; pkg_get_variable(),
>> pkg_check_modules(), pkg_search_module() are different from my purpose.
>>
>> in my impression, these functions are designed to retrieve the infos
>> from/via pkg-config, not to generate the infos to be written in pkg-
>> config's pc files.
>>
>> for the function 1 (lookup an available module from a list),
>> pkg_check_modules() and pkg_search_module() are candidate, but
>> they are not the straight solutions.
>>
>> taking a case that trying to find available module from libjpeg,
>> libjpeg8, libjpeg8-turbo, libjpeg9, libjpeg62, how pkg_check_modules()
>> or pkg_search_module() could be used? it would be something like...
>>
>> pkg_check_modules(_pc libjpeg libjpeg8 libjpeg8-turbo libjpeg9 libjpeg62)
>> foreach(mod IN LISTS "libjpeg;libjpeg8;libjpeg8-turbo;libjpeg9;libjpeg62")
>>if (NOT ("${_pc_${mod}_VERSION}" STREQUAL ""))
>>  set(FOUND_MOD "${mod}")
>>endif()
>> endforeach(mod)
>> message("${FOUND_MOD} is first available module")
>>
>> I think it's slightly troublesome, because I have to write single
>> list at 2 places, in different syntax.
>>
>> --
>>
>> Also, yet I'm not sure how IMPORTED_TARGET could be used to make
>> "-L/xxx -lyyy" from "/xxx/libyyy.so". According to
>> https://cmake.org/cmake/help/latest/command/target_link_libraries.html
>> , the contents of the imported target are the full pathnames of
>> the libraries, or, the plain library name ("bar" of "libbar.so"),
>> or other linker flag. The function I'm looking for is a conversion
>> *from* the full pathname *to* linker flag + plain library name.
>> I cannot find if imported target has a conversion feature from one
>> to another - am I overlooking something important?
>>
>> Regards,
>> mpsuzuki
>>
>> Craig Scott wrote:
>>> You most likely want to use the 
>>> FindPkgConfig<https://cmake.org/cmake/help/latest/module/FindPkgConfig.html>
>>>  module and also use the IMPORTED_TARGET option with the commands provided 
>>> therein.
>>>
>>> On Tue, Mar 27, 2018 at 11:19 PM, suzuki toshiya 
>>> mailto:mpsuz...@hiroshima-u.ac.jp>> wrote:
>>> Hi all,
>>>
>>> I'm looking for 2 features to generate pkg-config pc files.
>>> I already wrote something, but some experts advised that there
>>> would be many people trying to do such, and there might be existing
>>> solution. If such functions are already included in cmake's
>>> official modules, please let me know. Of course, combination
>>> of existing functions would be OK.
>>>
>>> function 1)
>>> ---
>>>
>>> ...is trying to fin

Re: [CMake] looking for 2 features to help pkg-config pc files

2018-03-27 Thread suzuki toshiya
Dear Craig,

Thank you for prompt reply. But all 3 functions; pkg_get_variable(),
pkg_check_modules(), pkg_search_module() are different from my purpose.

in my impression, these functions are designed to retrieve the infos
from/via pkg-config, not to generate the infos to be written in pkg-
config's pc files.

for the function 1 (lookup an available module from a list),
pkg_check_modules() and pkg_search_module() are candidate, but
they are not the straight solutions.

taking a case that trying to find available module from libjpeg,
libjpeg8, libjpeg8-turbo, libjpeg9, libjpeg62, how pkg_check_modules()
or pkg_search_module() could be used? it would be something like...

pkg_check_modules(_pc libjpeg libjpeg8 libjpeg8-turbo libjpeg9 libjpeg62)
foreach(mod IN LISTS "libjpeg;libjpeg8;libjpeg8-turbo;libjpeg9;libjpeg62")
  if (NOT ("${_pc_${mod}_VERSION}" STREQUAL ""))
set(FOUND_MOD "${mod}")
  endif()
endforeach(mod)
message("${FOUND_MOD} is first available module")

I think it's slightly troublesome, because I have to write single
list at 2 places, in different syntax.

--

Also, yet I'm not sure how IMPORTED_TARGET could be used to make
"-L/xxx -lyyy" from "/xxx/libyyy.so". According to
https://cmake.org/cmake/help/latest/command/target_link_libraries.html
, the contents of the imported target are the full pathnames of
the libraries, or, the plain library name ("bar" of "libbar.so"),
or other linker flag. The function I'm looking for is a conversion
*from* the full pathname *to* linker flag + plain library name.
I cannot find if imported target has a conversion feature from one
to another - am I overlooking something important?

Regards,
mpsuzuki

Craig Scott wrote:
> You most likely want to use the 
> FindPkgConfig<https://cmake.org/cmake/help/latest/module/FindPkgConfig.html> 
> module and also use the IMPORTED_TARGET option with the commands provided 
> therein.
> 
> On Tue, Mar 27, 2018 at 11:19 PM, suzuki toshiya 
> mailto:mpsuz...@hiroshima-u.ac.jp>> wrote:
> Hi all,
> 
> I'm looking for 2 features to generate pkg-config pc files.
> I already wrote something, but some experts advised that there
> would be many people trying to do such, and there might be existing
> solution. If such functions are already included in cmake's
> official modules, please let me know. Of course, combination
> of existing functions would be OK.
> 
> function 1)
> ---
> 
> ...is trying to find an available pkg-config module name from a
> list of several candidates. the typical usecase would be a
> search of libjpeg by pkg-config (libjpeg? libjpeg8? libjpeg8-turbo?
> libjpeg9? libjpeg62? ...). getting a name of module is important
> to write "Require" variable of pc file.
> 
> there is already pkg_search_module() searching an available module
> from a list, but it does not return the name of found module.
> thus it cannot help to write "Require" variable.
> 
> what I wrote is something like this.
> 
> #
> # PKG_SEARCH_AVAILABLE_MODULE([var-name-of-found-module] [modules])
> #
> # there is pkg_search_module(), but it does not clarify
> # which module was found.
> #
> # this function does not set xxx_CFLAGS xxx_LIBS etc.
> #
> # use like:
> # PKG_SEARCH_AVAILABLE_MODULE(PC_LIBJPEG
> "libjpeg;libjpeg8-turbo;libjpeg8;libjpeg9;libjpeg62")
> #
> function(PKG_SEARCH_AVAILABLE_MODULE _found_pkg pkg_list)
>   set(_PKG_FOUND FALSE)
>   foreach(_pkg IN LISTS pkg_list)
> pkg_check_modules(_PKG "${_pkg}")
> if (_PKG_FOUND)
>   set("${_found_pkg}_FOUND" TRUE PARENT_SCOPE)
>   set("${_found_pkg}_MODULE_NAME" "${_pkg}" PARENT_SCOPE)
>   return()
> endif()
>   endforeach(_pkg)
> endfunction(PKG_SEARCH_AVAILABLE_MODULE)
> 
> function 2)
> ---
> ...makes something like LDFLAGS + LIBS from the pathnames of libraries.
> some library finders of cmake do not return "-L/xxx -lyyy" values
> but returns "/xxx/libyyy.so". pkg-config has some difficulties
> to hold such raw pathnames of the libraries (e.g. pkg-config
> use "Libs" variable for both of static and shared linking,
> thus having "libxxx.a" or "libxxx.so" explicitly is not good),
> so, the translation from "/xxx/libyyy.so" to "-L/xxx -lyyy".
> 
> what I wrote is something like this:
> 
> #
> # MAKE_LDFLAGS_FROM_LIBPATH([var-ldflags+libs] [libpath])
> #
> function(MAKE_LDFLAGS_FROM_LIBPATHS _ldflags _libpaths)
>   foreach(_libpath IN LISTS _libpaths)
> string(REGEX REPLACE "/[^/]*$" "" _libdir "${_libpath}")
> 
> 

[CMake] looking for 2 features to help pkg-config pc files

2018-03-27 Thread suzuki toshiya
Hi all,

I'm looking for 2 features to generate pkg-config pc files.
I already wrote something, but some experts advised that there
would be many people trying to do such, and there might be existing
solution. If such functions are already included in cmake's
official modules, please let me know. Of course, combination
of existing functions would be OK.

function 1)
---

...is trying to find an available pkg-config module name from a
list of several candidates. the typical usecase would be a
search of libjpeg by pkg-config (libjpeg? libjpeg8? libjpeg8-turbo?
libjpeg9? libjpeg62? ...). getting a name of module is important
to write "Require" variable of pc file.

there is already pkg_search_module() searching an available module
from a list, but it does not return the name of found module.
thus it cannot help to write "Require" variable.

what I wrote is something like this.

#
# PKG_SEARCH_AVAILABLE_MODULE([var-name-of-found-module] [modules])
#
# there is pkg_search_module(), but it does not clarify
# which module was found.
#
# this function does not set xxx_CFLAGS xxx_LIBS etc.
#
# use like:
# PKG_SEARCH_AVAILABLE_MODULE(PC_LIBJPEG
"libjpeg;libjpeg8-turbo;libjpeg8;libjpeg9;libjpeg62")
#
function(PKG_SEARCH_AVAILABLE_MODULE _found_pkg pkg_list)
  set(_PKG_FOUND FALSE)
  foreach(_pkg IN LISTS pkg_list)
pkg_check_modules(_PKG "${_pkg}")
if (_PKG_FOUND)
  set("${_found_pkg}_FOUND" TRUE PARENT_SCOPE)
  set("${_found_pkg}_MODULE_NAME" "${_pkg}" PARENT_SCOPE)
  return()
endif()
  endforeach(_pkg)
endfunction(PKG_SEARCH_AVAILABLE_MODULE)

function 2)
---
...makes something like LDFLAGS + LIBS from the pathnames of libraries.
some library finders of cmake do not return "-L/xxx -lyyy" values
but returns "/xxx/libyyy.so". pkg-config has some difficulties
to hold such raw pathnames of the libraries (e.g. pkg-config
use "Libs" variable for both of static and shared linking,
thus having "libxxx.a" or "libxxx.so" explicitly is not good),
so, the translation from "/xxx/libyyy.so" to "-L/xxx -lyyy".

what I wrote is something like this:

#
# MAKE_LDFLAGS_FROM_LIBPATH([var-ldflags+libs] [libpath])
#
function(MAKE_LDFLAGS_FROM_LIBPATHS _ldflags _libpaths)
  foreach(_libpath IN LISTS _libpaths)
string(REGEX REPLACE "/[^/]*$" "" _libdir "${_libpath}")

string(REGEX REPLACE "^.*/" "" _lib "${_libpath}")
string(REGEX REPLACE
"(\\${CMAKE_STATIC_LIBRARY_SUFFIX}|\\${CMAKE_SHARED_LIBRARY_SUFFIX})$" "" _lib
"${_lib}")
string(REGEX REPLACE "^lib" "" _lib "${_lib}")

set(__ldflags "${__ldflags} ${CMAKE_LIBRARY_PATH_FLAG}${_libdir}
${CMAKE_LINK_LIBRARY_FLAG}${_lib}")
  endforeach(_libpath)
  set("${_ldflags}" "${__ldflags}" PARENT_SCOPE)
endfunction(MAKE_LDFLAGS_FROM_LIBPATH)

Regards,
mpsuzuki

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake