Coder Social home page Coder Social logo

Comments (21)

paulfitz avatar paulfitz commented on July 17, 2024

Thanks for reporting this. I believe those two files are no longer used in YARP's build process. Removing them has no effect (on Linux), and I see no reference to them in CMake project files. Hard to believe that Xcode would scan them itself. Can you post some more details of the error?

from yarp.

drdanz avatar drdanz commented on July 17, 2024

I was debugging this with @iron76 and the error is just "cannot find -lACE"
It is really weird, because cmake FindAce uses the whole path for the library, .pc.in files are never used, and by removing the -lACE from those file it builds with no error.

@iron76 can you try deleting those files and building again?

However, I think that having files for pkg-config is a good idea though... several cmake projects install one in parallel to the CMake exports stuff, so that packages using pkg-config will be able to use YARP anyway.

from yarp.

iron76 avatar iron76 commented on July 17, 2024

Not sure that we did everything correctly since now I got the usual linking error (ld: library not found for -lACE) when compiling the yarprun target. This linking error displays regardless of the presence of the two files.
Francesco

from yarp.

paulfitz avatar paulfitz commented on July 17, 2024

strange. I see that src/yarprun/CMakeLists.txt has a stray line in it:

include_directories(${ACE_INCLUDE_DIRS})

That shouldn't be needed - but also shouldn't have "-lACE" in it. Still, can't think of much else. Will check.

from yarp.

paulfitz avatar paulfitz commented on July 17, 2024

Could you maybe post CMakeCache.txt and any build logs you can cobble together in a pastebin/similar? I'm not seeing where the -lACE would have come from.

from yarp.

iron76 avatar iron76 commented on July 17, 2024

The issue seems to be related to the way linker flags are set. In particular, my CMakeCache.txt contains the following line:

ACE_LDFLAGS:INTERNAL=-L/usr/local/Cellar/ace/6.1.8/lib;-lACE

However the generated Xcode project does not contain both these flags but only the second (-lACE). Manually inserting both fixes the problem. Similarly, the problem is fixed by adding a proper search path to the "Library Search Paths" configuration. This information is contained in the following CMakeCache.txt line:

ACE_LIBDIR:INTERNAL=/usr/local/Cellar/ace/6.1.8/lib

I hope this can help.
Francesco

from yarp.

iron76 avatar iron76 commented on July 17, 2024

Update. In my case, the Ace linking problem under XCode (ccmake ./ -G Xcode) can be fixed by removing the PKG config lines in the $YARP_ROOT/src/FindACE.cmake file.

if (PKG_CONFIG_FOUND)

pkg_check_modules(ACE ACE)

if (ACE_FOUND)

set(ACE_INCLUDE_DIR_GUESS ${ACE_INCLUDE_DIRS})

set(ACE_LIBRARY_DIR_GUESS ${ACE_LIBRARY_DIRS})

set(ACE_LINK_FLAGS ${ACE_LDFLAGS})

set(ACE_C_FLAGS ${ACE_CFLAGS})

endif (ACE_FOUND)

endif (PKG_CONFIG_FOUND)

I remember we fixed a similar issue in a better way some times ago with Lorenzo Natale at vvv12 (probably a regression bug). If I remember correctly the ACE_* variables are configured in a wrong way by the commented lines above. Still these configuration variables are used by certain targets (and this causes the linking error). After this wrong configuration, the variables are correctly configured by the other lines of the FindACE.cmake file. Certain variables are overwritten correctly and this causes certain other modules to compile correctly.
I hope this helps.
Francesco

from yarp.

drdanz avatar drdanz commented on July 17, 2024

can you run on a command line:

pkg-config --libs ACE
pkg-config --libs-only-l ACE
pkg-config --libs-only-L ACE
pkg-config --libs-only-other ACE

from yarp.

iron76 avatar iron76 commented on July 17, 2024

pkg-config --libs ACE --> -L/usr/local/Cellar/ace/6.1.8/lib -lACE
pkg-config --libs-only-l ACE --> -lACE
pkg-config --libs-only-L ACE --> -L/usr/local/Cellar/ace/6.1.8/lib
pkg-config --libs-only-other ACE -->

from yarp.

drdanz avatar drdanz commented on July 17, 2024

ok, this seems correct.
Can you try running this in YARP source directory?

cmake --find-package -DNAME=ACE -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=LINK -DCMAKE_MODULE_PATH=$XXX/conf

where $XXX is the path to the file FindACE.cmake

Also try running the same command changing COMPILER_ID to something else, and adding -G Xcode to the command line

from yarp.

iron76 avatar iron76 commented on July 17, 2024

cmake --find-package -DNAME=ACE -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=LINK -DCMAKE_MODULE_PATH=/Users/iron/Code/yarp/conf

gives:

/usr/local/lib/libACE.dylib

cmake -G Xcode --find-package -DNAME=ACE -DCOMPILER_ID=Xcode -DLANGUAGE=CXX -DMODE=LINK -DCMAKE_MODULE_PATH=/Users/iron/Code/yarp/conf

gives:

/usr/local/lib/libACE.dylib

from yarp.

paulfitz avatar paulfitz commented on July 17, 2024

One solution might be to feed the results of pkg-config (particularly ACE_LIBRARY_DIRS) into a call to FIND_LIBRARY, so that we end up with an absolute path to the ACE library in all cases. Another solution is to pepper LINK_DIRECTORIES(${ACE_LIBRARY_DIRS}) here and there, which is rarely fun.

from yarp.

iron76 avatar iron76 commented on July 17, 2024

Well, not sure that I am the right person to choose the right solution. I let you guys decide but in the mean while I have a workaround to compile with Xcode.
Francesco


Francesco Nori Robotics Brain Cognitive Science Department
Cognitive Humanoids Lab Istituto Italiano di Tecnologia
Via Morego, 30 16163 Genova, Italy
http://people.liralab.it/iron/ [email protected]:[email protected]

Phone: (+39) 010 71 781 420 Fax: +39 010 71 70 817

On May 8, 2013, at 3:28 AM, paulfitz wrote:

One solution might be to feed the results of pkg-config (particularly ACE_LIBRARY_DIRS) into a call to FIND_LIBRARY, so that we end up with an absolute path to the ACE library in all cases. Another solution is to pepper LINK_DIRECTORIES(${ACE_LIBRARY_DIRS}) here and there, which is rarely fun.


Reply to this email directly or view it on GitHubhttps://github.com//issues/14#issuecomment-17581449.

from yarp.

drdanz avatar drdanz commented on July 17, 2024

I'm strongly against the LINK_DIRECTORIES command, that i think is going to be deprecated in the future...
The problem is probably in the FindACE.cmake file.

@iron76 can you try replacing the content of that files with just these 2 lines

include(MacroStandardFindModule) macro_standard_find_module(ACE ACE)

and to copying the MacroStandardFindModule.cmake file from the yarp-2.4 branch in the conf directory?

(you can just copy and paste the file from here)
https://github.com/robotology/yarp/blob/yarp-2.4/conf/MacroStandardFindModule.cmake

If it works, it means that we just have to fix the FindACE.cmake file to behave properly

from yarp.

paulfitz avatar paulfitz commented on July 17, 2024

Are we stuck here? @iron76 has a workaround he's happy with and @drdanz, @paulfitz don't have macs...

from yarp.

iron76 avatar iron76 commented on July 17, 2024

Sorry, I was busy at ICRA and right in Luxemburg :) Apparently I am missing a macro:

CMake Error at conf/MacroStandardFindModule.cmake:93 (macro_extract_version):
Unknown CMake command "macro_extract_version".

Francesco


Francesco Nori Robotics Brain Cognitive Science Department
Cognitive Humanoids Lab Istituto Italiano di Tecnologia
Via Morego, 30 16163 Genova, Italy
http://people.liralab.it/iron/ [email protected]:[email protected]

Phone: (+39) 010 71 781 420 Fax: +39 010 71 70 817

On May 8, 2013, at 3:10 PM, Daniele E. Domenichelli wrote:

I'm strongly against the LINK_DIRECTORIES command, that i think is going to be deprecated in the future...
The problem is probably in the FindACE.cmake file.

@iron76https://github.com/iron76 can you try replacing the content of that files with just these 2 lines

include(MacroStandardFindModule)
macro_standard_find_module(ACE ACE)

and to copying the MacroStandardFindModule.cmake file from the yarp-2.4 branch in the conf directory?

(you can just copy and paste the file from here)
https://github.com/robotology/yarp/blob/yarp-2.4/conf/MacroStandardFindModule.cmake

If it works, it means that we just have to fix the FindACE.cmake file to behave properly


Reply to this email directly or view it on GitHubhttps://github.com//issues/14#issuecomment-17604334.

from yarp.

drdanz avatar drdanz commented on July 17, 2024

right, I'm sorry... you will need this file as well
https://github.com/robotology/yarp/blob/yarp-2.4/conf/MacroExtractVersion.cmake

from yarp.

iron76 avatar iron76 commented on July 17, 2024

Works greatly.
Thanks Daniele and Paul.
Francesco

from yarp.

drdanz avatar drdanz commented on July 17, 2024

So this means that FindACE.cmake is broken on MAC with XCODE generator. So now we just have to debug it and find the problem, or remove all the "UNIX" part and replace it with the macro, and keep just the MSVC part...

from yarp.

paulfitz avatar paulfitz commented on July 17, 2024

@drdanz +1 for replacing the UNIX part with your standardized approach. Along with the MSVC stanza, I think the MINGW stanza would also need to stay.

from yarp.

drdanz avatar drdanz commented on July 17, 2024

Now that we merged 2.4 we should port FindACE.cmake to use MacroStandardFindModule

from yarp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.