Arm port

Óscar Fuentes wrote:

Chuck Robey <chuckr@telenix.org> writes:

[snip]

Someone said that maybe CMake is already compatible with BSD make, so
I quicly went into one of your Makefiles and took out the first
incompatibility I found. Means ONLY that CMake != BSD Make, that's
all. Looks to me to be a great deal more like GNU Make, isn't that
so?

As said on my previous reply to you, the makefiles distributed with LLVM
are not related to CMake.

[snip]

My own feeling is that adding in the ability to generate BSD Makefiles
from Cmake files is going to tremendously compllicate the ability to
fix build problems,

I've never asked for (and wouldn't personally contribute to) any project to
generate BSD Makefiles from CMake input. My feelings are, you generate BSD
Makefiles directly, they are NOT that complicated, and making them be generated
like that reduces the simplicity, make troubleshooting more difficult.

Maybe there is a common misunderstanding here. CMake is not a build
tool, it is a build generator tool. That means that it competes with the
GNU autotools, for instance, but not with make, or gmake. CMake
generates makefiles (or project files for XCode, Visual Studio, etc) so
it actually requires some other tool (`make' in your case) for the
actual build. This is why I'm suggesting that you should check if CMake
generates makefiles compatible with BSD make, instead of writing (and
maintaining) them yourself. LLVM is a fast moving target: adding, moving
and removing source files and library requirements is common.

Ah, and as you may prefer to avoid the autotools, you need a
BSD-specific config.h file, don't you? In principle, CMake can provide
this too.

This last sentence is quite confusing. Further above, you said the build system
isn't CMake, but in this last sentence, you're defending CMake. I can't tell
what you're trying to say here. Is it only that you're saying you are 100%
dedicated to using CMake to generate makefiles? Well, In my own opinion, that
would be like requiring folks to use a code generator tool to create all of your
C++ code. I think that C++ files should be generated directly, and the same
goes for BSD Makefiles. They are very simple things, and adding in levels of
indirection just vastly complicates what should be a simple operation.

The idea that BSD Make is complicated by folks who were too busy to read the
manual which isn't all that hard to understand. Folks who then went out, wrote
their own builds systems which were universally more complex, but since they
were NEW, they had to be better. Even if you needed to have some testing of the
environment inside the makefiles, that's simple to accomplish right inside the
BSD Makefiles, FAR more simple than any autoconf script ever was.

I got told, at first, that all patches were welcome, but since then I've seen
some folks don't want patches. Far be it from me to give patches where they're
not wanted. I CAN say that the Makefiles that CMake is generating for you are
incompatible with BSD Make, and the BSD Makefiles would be hugely more simple
than CMake files, probably needing only the maintenance forced by moving source
file locations around.

I don't really want to continue this anyhow, I wanted to spend more time
learning compilers in general (and llvm in specific), and this is (for me)
offtopic. I ofered this only because I often know more about makefiles that
others. Not always true, of course.

Chuck Robey <chuckr@telenix.org> writes:

I've never asked for (and wouldn't personally contribute to) any project to
generate BSD Makefiles from CMake input. My feelings are, you generate BSD
Makefiles directly, they are NOT that complicated, and making them be generated
like that reduces the simplicity, make troubleshooting more difficult.

Fair enough, but BSD Make is no solution for the Visual Studio or XCode
users. Those users fall within the intended audience of LLVM.

Maybe there is a common misunderstanding here. CMake is not a build
tool, it is a build generator tool. That means that it competes with the
GNU autotools, for instance, but not with make, or gmake. CMake
generates makefiles (or project files for XCode, Visual Studio, etc) so
it actually requires some other tool (`make' in your case) for the
actual build. This is why I'm suggesting that you should check if CMake
generates makefiles compatible with BSD make, instead of writing (and
maintaining) them yourself. LLVM is a fast moving target: adding, moving
and removing source files and library requirements is common.

Ah, and as you may prefer to avoid the autotools, you need a
BSD-specific config.h file, don't you? In principle, CMake can provide
this too.

This last sentence is quite confusing. Further above, you said the build system
isn't CMake, but in this last sentence, you're defending CMake. I can't tell
what you're trying to say here.

I guess we are on different wavelengths. I'm trying to save you some
time, but failing miserably, so I'll stop here.

[snip]

I got told, at first, that all patches were welcome, but since then
I've seen some folks don't want patches. Far be it from me to give
patches where they're not wanted.

Those folks (specially me) are not the people who decide which patches
are accepted. So please go ahead if you wish.

I CAN say that the Makefiles that CMake is generating for you are
incompatible with BSD Make,

Just to clarify things: have you *tried* to build LLVM with the
makefiles generated by cmake on your BSD system? I repeat again that the
makefiles you get with the LLVM sources are not related to cmake. For
generating the makefiles follow the instructions here:

http://www.llvm.org/docs/CMake.html#quickstart

Extra thanks if you report the cmake version and the error messages
displayed on the console.

I think it is great news that clang/LLVM is adopted by the BSD community.
If my humble area of expertise within LLVM (the cmake build spec) is
potentially useful for them, certainly I would contribute some time.

[snip]

[snip]

Just to clarify things: have you *tried* to build LLVM with the
makefiles generated by cmake on your BSD system?

Just checked that the makefiles generated by cmake work with `make' on
FreeBSD 7.2 x86. The build fails while building `opt' because libdl is
missing.

Óscar Fuentes wrote:

Chuck Robey <chuckr@telenix.org> writes:

I've never asked for (and wouldn't personally contribute to) any project to
generate BSD Makefiles from CMake input. My feelings are, you generate BSD
Makefiles directly, they are NOT that complicated, and making them be generated
like that reduces the simplicity, make troubleshooting more difficult.

Fair enough, but BSD Make is no solution for the Visual Studio or XCode
users. Those users fall within the intended audience of LLVM.

Maybe there is a common misunderstanding here. CMake is not a build
tool, it is a build generator tool. That means that it competes with the
GNU autotools, for instance, but not with make, or gmake. CMake
generates makefiles (or project files for XCode, Visual Studio, etc) so
it actually requires some other tool (`make' in your case) for the
actual build. This is why I'm suggesting that you should check if CMake
generates makefiles compatible with BSD make, instead of writing (and
maintaining) them yourself. LLVM is a fast moving target: adding, moving
and removing source files and library requirements is common.

Ah, and as you may prefer to avoid the autotools, you need a
BSD-specific config.h file, don't you? In principle, CMake can provide
this too.

This last sentence is quite confusing. Further above, you said the build system
isn't CMake, but in this last sentence, you're defending CMake. I can't tell
what you're trying to say here.

I guess we are on different wavelengths. I'm trying to save you some
time, but failing miserably, so I'll stop here.

[snip]

I got told, at first, that all patches were welcome, but since then
I've seen some folks don't want patches. Far be it from me to give
patches where they're not wanted.

Those folks (specially me) are not the people who decide which patches
are accepted. So please go ahead if you wish.

I CAN say that the Makefiles that CMake is generating for you are
incompatible with BSD Make,

Just to clarify things: have you *tried* to build LLVM with the
makefiles generated by cmake on your BSD system? I repeat again that the
makefiles you get with the LLVM sources are not related to cmake. For
generating the makefiles follow the instructions here:

Building LLVM with CMake — LLVM 16.0.0git documentation

Extra thanks if you report the cmake version and the error messages
displayed on the console.

I think it is great news that clang/LLVM is adopted by the BSD community.
If my humble area of expertise within LLVM (the cmake build spec) is
potentially useful for them, certainly I would contribute some time.

Actually, after I sent my last, I was worried that maybe I'd gotten too extreme,
because I really, truly dislike systems like autoconf, they make troubleshooting
easy things like builds extremely complicated. As far as BSD goes, when it gets
adopted (and I think it's a pretty fair bet that it's going to be, at this
point), the BSD folks will certainly retofit it with BSD makefiles. You don't
have to give it to them, because if you don't, they will make their own (it's
not all that difficult, our BSD template makefile system does all the heavy
lifting without terribly overcomplicating the build from a troubleshooting
perspective. When this started, someone stated they'd be willing to look at
contributed BSD Makefiles, but please understand this, it means just exactly
what it says: look at them, NOT accept them. You have to look at something to
decide if it meets your idea of what the project is supposed to do, and anyone
who expects that anything they write is going to be accepted is acting unreal.
Also, I wouldn't expect you to toss away your present build system, and adding
BSD makefiles wouldn't require anything like that.

With what's occurred in the last few days, I don't think I'm going to contribute
Makefiles after all, it seems to be pretty much universally misinterpreted as
"anything contributed has to be accepted", and I won't get involved in anything
so insane. Like I said, any BSD who accepts the llvm system is going to
implement BSD Makefiles on their own, whether you have them or not. Look at our
(FreeBSD)'s present implementation of BSD makefiles for gcc. It doesn't
interfere with gcc any, but we don't ever run that abhorrent configuration
script. Not that everyone in BSD necessarily feels as I do about configuration
scripts, but they DO expect to use their own BSD Makefiles, that's universally
true. Looking back in history, I *think* the only system that didn't use BSD
Makefiles was way back when we had Perl in the base system. I *think* that we
had some compromise system, back then, for Perl, but that's the last time such a
thing has happened.

Lets just let this topic die, before I do accidentally say something I will
regret, because those confiuration script do happen to be a hot-button topic for
me, and I would really rather not embarrass myself here. I *like* the llvm project.

Óscar Fuentes wrote:

[snip]

Just to clarify things: have you *tried* to build LLVM with the
makefiles generated by cmake on your BSD system?

Just checked that the makefiles generated by cmake work with `make' on
FreeBSD 7.2 x86. The build fails while building `opt' because libdl is
missing.

They absolutely do work, even on FreeBSD-current( I run that here), but not
using the native make (the one built as part of "make world" which is a direct
descendant of "pmake". You have to use the GNU make, which is easily enough
added to any FreeBSD system via the FreeBSD ports system. However, when llvm is
brought into our base system (as is intended, I'm certain) BSD Makefiles will be
added, rather easily. If you're curious how such a thing can be done, in a
perfectly non-interfecring way, without your even being aware of it, I could
tell you, just let me know if you're curious. I know our make and the GNU make,
both, pretty well.

I did give you one example of a statement I found in your makefiles, which I'm
absolutely certain can't be understood by our make. Among several other things,
the "gmake" and "bmake" makefile conditionals don't look very much alike. You
CAN'T write one makefile which will automatically work in either system, I tried
that some years ago. I could explain that, too, but I won't bore you, unless
you tell me you're interested.

I've been wanting to recode our bame, to produce one make system that would
allow makefiles to operate automatically in either environment. I haven't
started on that task, yet.

Chuck Robey <chuckr@telenix.org> writes:

Just checked that the makefiles generated by cmake work with `make' on
FreeBSD 7.2 x86. The build fails while building `opt' because libdl is
missing.

They absolutely do work, even on FreeBSD-current( I run that here),
but not using the native make (the one built as part of "make world"
which is a direct descendant of "pmake". You have to use the GNU
make,

Uh? My FreeBSD installment has `make' and no `gmake'. `make' is indeed
BSD make.

So, to recap, right now LLVM svn builds fine on FreeBSD 7.2 using BSD
`make' with the makefiles generated by cmake.

[snip]

I did give you one example of a statement I found in your makefiles,
which I'm absolutely certain can't be understood by our make.

It is obvious that you are not reading what I write.

[snip]

Hi,

Óscar Fuentes wrote:

Chuck Robey <chuckr@telenix.org> writes:

Just checked that the makefiles generated by cmake work with `make' on
FreeBSD 7.2 x86. The build fails while building `opt' because libdl is
missing.
      

They absolutely do work, even on FreeBSD-current( I run that here),
but not using the native make (the one built as part of "make world"
which is a direct descendant of "pmake". You have to use the GNU
make,
    
Uh? My FreeBSD installment has `make' and no `gmake'. `make' is indeed
BSD make.

So, to recap, right now LLVM svn builds fine on FreeBSD 7.2 using BSD
`make' with the makefiles generated by cmake.
  

I quickly browsed the CMake 2.6.2 source and their does not seem to be a
special case for BSD in the makefile generator code.
It seems that the makefiles generated by cmake use the subset of
features that is shared by BSD make and GNU make
([Cmake] Problems finding programs on FreeBSD), so
building with either BSD make or GNU make should work.

However, I also noticed that KDE4 uses CMake these days and on a page
(http://techbase.kde.org/Getting_Started/Build/KDE4/FreeBSD) that
describes building on FreeBSD it says "Sometimes, building with *make*
can fail on some modules. You should try using *gmake* instead." So
perhaps YMMV...

Regards,
Paul

Óscar Fuentes wrote:

Chuck Robey <chuckr@telenix.org> writes:

Just checked that the makefiles generated by cmake work with `make' on
FreeBSD 7.2 x86. The build fails while building `opt' because libdl is
missing.

They absolutely do work, even on FreeBSD-current( I run that here),
but not using the native make (the one built as part of "make world"
which is a direct descendant of "pmake". You have to use the GNU
make,

Uh? My FreeBSD installment has `make' and no `gmake'. `make' is indeed
BSD make.

So, to recap, right now LLVM svn builds fine on FreeBSD 7.2 using BSD
`make' with the makefiles generated by cmake.

[snip]

I did give you one example of a statement I found in your makefiles,
which I'm absolutely certain can't be understood by our make.

It is obvious that you are not reading what I write.

Not completely, because (at least to me) it's not making sense against what I
find. I'd been lookiing at the llvm version 2.3, so I just got a copy of 2.5,
and I looked at the Makefile that came right out of the tarball, then I
regenerated the Makefile via the supplied configure script. Right at the top of
both Makefiles is the GNU-style conditional "ifeq", and that's a GNU
conditional, one which just CAN'T work from any BSD Make (would you mind if I
abbreviated GNU Make with "gmake" and the BSD Make with "bmake" ?) Anyhow, this
is the evidence I have that shows me that it's just not possible that you ran
this Makefile via bmake. OK, the -f argument can be used to make either bmake
or gmake use files other than the default ones (first default "makefile", 2nd
default "Makefile", and there are others), so if you want to tell me that I need
to look at some other file, what's it's name? I mean, you have to admit, I
think, that I have some evidence here which at first glance seems to prove to me
that it's not possible to run your build scripts via bmake.

However, I can think of a set of unlikely scenarios where I could be wrong, so
lets talk about it, ok? Honestly, I detest arguing about this, because I *like*
your project, and don't want to be in this position, disagreeing with you. On
top of this, I don't much like arguing to begin with, and finally, I have this
bias against the horde of folks who can't be bothered to learn either gmake or
bmake, and need to write up one of the now large horde of {b|g}make wannabees.
These all make troubleshooting more difficult, and that's truly my hot button.
To me, it's more imporatnt to be able to figure out what's wrong than any other
possible goal. You might not agree with me, but I'm being honest in admitting
that's my true #1 goal, more important than anything else.

If you want to use the CMake build system, don't run configure.
configure is just plain old autoconf, that uses the supplied GNU makefiles.

See http://llvm.org/docs/CMake.html on how to use cmake, you should look
at the makefiles that cmake creates,
not configure.

Best regards,
--Edwin

Chuck Robey wrote:

Óscar Fuentes wrote:
  

Chuck Robey <chuckr@telenix.org> writes:

Just checked that the makefiles generated by cmake work with `make' on
FreeBSD 7.2 x86. The build fails while building `opt' because libdl is
missing.
        

They absolutely do work, even on FreeBSD-current( I run that here),
but not using the native make (the one built as part of "make world"
which is a direct descendant of "pmake". You have to use the GNU
make,
      

Uh? My FreeBSD installment has `make' and no `gmake'. `make' is indeed
BSD make.

So, to recap, right now LLVM svn builds fine on FreeBSD 7.2 using BSD
`make' with the makefiles generated by cmake.

[snip]

I did give you one example of a statement I found in your makefiles,
which I'm absolutely certain can't be understood by our make.
      

It is obvious that you are not reading what I write.
    
Not completely, because (at least to me) it's not making sense against what I
find. I'd been lookiing at the llvm version 2.3, so I just got a copy of 2.5,
and I looked at the Makefile that came right out of the tarball, then I
regenerated the Makefile via the supplied configure script.

You have verified that the current autoconf/configure system won't work for *BSD.

That has nothing to do with CMake.

Mike Stump wrote:

Paul Melis wrote:

Hi,

Óscar Fuentes wrote:

Chuck Robey <chuckr@telenix.org> writes:

Just checked that the makefiles generated by cmake work with `make' on
FreeBSD 7.2 x86. The build fails while building `opt' because libdl is
missing.
      

They absolutely do work, even on FreeBSD-current( I run that here),
but not using the native make (the one built as part of "make world"
which is a direct descendant of "pmake". You have to use the GNU
make,

Both BSD Make and GNU make run on FreeBSD (as long as you do install GNU Make,
because it's not part of the base install, however 90% of folks will install it.
They coexist with no problem.

Uh? My FreeBSD installment has `make' and no `gmake'. `make' is indeed
BSD make.

In your FreeBSD system, do an "ls -d /var/db/pkg/gmake*" and see if any
directory shows up. If it does, then the only argument you can have is what
name you installed it under, not whether it's there or not, it is. GNU Make,
and NOT BSD Make, will respond to the -v parameter with version info. BSD make
won't do that.

So, to recap, right now LLVM svn builds fine on FreeBSD 7.2 using BSD
`make' with the makefiles generated by cmake.
  

I quickly browsed the CMake 2.6.2 source and their does not seem to be a
special case for BSD in the makefile generator code.
It seems that the makefiles generated by cmake use the subset of
features that is shared by BSD make and GNU make
([Cmake] Problems finding programs on FreeBSD), so
building with either BSD make or GNU make should work.

However, I also noticed that KDE4 uses CMake these days and on a page
(http://techbase.kde.org/Getting_Started/Build/KDE4/FreeBSD) that
describes building on FreeBSD it says "Sometimes, building with *make*
can fail on some modules. You should try using *gmake* instead." So
perhaps YMMV...

Let me explain a bit. Things that are part of FreeBSD ports are built using
whatever build tool is called for, but if it's brought in as part of the FreeBSD
base code (as I expect llvm will be) then there will be additional Makefiles
provided by FreeBSD programmers (in separate directories, they won't interfere
or overwrite the Makefiles that come with llvm, they'll just use source pathing
to refer to the source files, and force the build to be run via BSD Make) so
that the build can be guided by the BSD Make. Unless you understand how Make
works (and this feature works for both GNU Make and BSD Make, if under different
names, the GNU Make folks call this VPATH) then you might not even realize that
BSD Make is in control. I would.

There is already a llvm *port*, it's using whatever is native to llvm, it looks
like CMake is provided, but GNU Make compatible Makefiles (via configure) are
being used. I looked at the Makefiles being produced, they're not bmake
compatible. I don't care what they claim, look at the actual Makefiles being
produced.

I already gave you a couple of very easy to spot sentinels, ways you can
absolutely prove the code is or is not GNU Make(gmake), or BSD Make (bmake):
look for the conditionals, they don't look alike, and they aren't cross
compatible. One obvious example is the gmake uses "ifeq" there bmake uses ".if
(var1==var2)". If you spot a "ifeq" then you can argue that it's bmake all you
want, you'd still be wrong. I don't know CMake all that well, I believe it can
generate gmake compatible Makefiles, but if it puts something like "ifeq" into
the Makefiles it produces, then don't believe the documentation that says it's
cross compatible with BSD, it won't be, the ifeq constructs are clear evidence.

It's NOT possible to make a single Makefile, one that has conditionals in it, be
compatible with both bmake and gmake, because their conditionals don't look
alike. It's possible to produce a bmake or gmake compatible makefile, but I
haven't seen any project do that, actually. Certainly, you can write (for the
autoconf) a Makefile.in that would be compatible with bmake, but I never saw
that actually done, have you?

Török Edwin wrote:

Óscar Fuentes wrote:
  

Chuck Robey <chuckr@telenix.org> writes:

Just checked that the makefiles generated by cmake work with `make' on
FreeBSD 7.2 x86. The build fails while building `opt' because libdl is
missing.
        

They absolutely do work, even on FreeBSD-current( I run that here),
but not using the native make (the one built as part of "make world"
which is a direct descendant of "pmake". You have to use the GNU
make,
      

Uh? My FreeBSD installment has `make' and no `gmake'. `make' is indeed
BSD make.

So, to recap, right now LLVM svn builds fine on FreeBSD 7.2 using BSD
`make' with the makefiles generated by cmake.

[snip]

I did give you one example of a statement I found in your makefiles,
which I'm absolutely certain can't be understood by our make.
      

It is obvious that you are not reading what I write.
    

Not completely, because (at least to me) it's not making sense against what I
find. I'd been lookiing at the llvm version 2.3, so I just got a copy of 2.5,
and I looked at the Makefile that came right out of the tarball, then I
regenerated the Makefile via the supplied configure script. Right at the top of
both Makefiles is the GNU-style conditional "ifeq", and that's a GNU
conditional,

If you want to use the CMake build system, don't run configure.
configure is just plain old autoconf, that uses the supplied GNU makefiles.

Not necessarily true, if one writes up a Makefile.in to be compatible with BSD
make, then you get a BSD Make compatibility (but not GNU Make, then). I've done
that myself. It's non-intuitive, I'll admit.

See http://llvm.org/docs/CMake.html on how to use cmake, you should look
at the makefiles that cmake creates,

I looked at the llvm I could download, the tarball llvm-2.5.tar.gz, both at the
Makefile that was originally supplied AND the one that's there after you do a
configure. They both have "ifeq" constructs right up at the top of the
Makefile, which are inarguably not BSD Make compatible. They ARE GNU Make
compatible, I don't really understand CMake well enough to comment on that.
Under another email, I described the easiest way to tell if a Makefile is or
isn't BSD/GNU Make compatible.

Paul Melis <llvm@assumetheposition.nl> writes:

The files generated by CMake are not guaranteed to be relocatable
(they use absolute paths).

A problem merely waiting for someone to fix it. If it is important,
it will be fixed.
  

Is the current support in CMake for generating makefiles with relative
paths not good enough?

No. And the cmake people think there is no easy fix.

Török Edwin wrote:
  

Óscar Fuentes wrote:
  

Chuck Robey <chuckr@telenix.org> writes:

Just checked that the makefiles generated by cmake work with `make' on
FreeBSD 7.2 x86. The build fails while building `opt' because libdl is
missing.
        

They absolutely do work, even on FreeBSD-current( I run that here),
but not using the native make (the one built as part of "make world"
which is a direct descendant of "pmake". You have to use the GNU
make,
      

Uh? My FreeBSD installment has `make' and no `gmake'. `make' is indeed
BSD make.

So, to recap, right now LLVM svn builds fine on FreeBSD 7.2 using BSD
`make' with the makefiles generated by cmake.

[snip]

I did give you one example of a statement I found in your makefiles,
which I'm absolutely certain can't be understood by our make.
      

It is obvious that you are not reading what I write.
    

Not completely, because (at least to me) it's not making sense against what I
find. I'd been lookiing at the llvm version 2.3, so I just got a copy of 2.5,
and I looked at the Makefile that came right out of the tarball, then I
regenerated the Makefile via the supplied configure script. Right at the top of
both Makefiles is the GNU-style conditional "ifeq", and that's a GNU
conditional,
      

If you want to use the CMake build system, don't run configure.
configure is just plain old autoconf, that uses the supplied GNU makefiles.
    
Not necessarily true, if one writes up a Makefile.in to be compatible with BSD
make, then you get a BSD Make compatibility (but not GNU Make, then). I've done
that myself. It's non-intuitive, I'll admit.
  
The Makefile.in and Makefiles supplied by default are GNU make, no doubt
about that.

But we where talking about CMake: it doesn't use the supplied
Makefile.in, or Makefile at all.
It generates the makefiles when you run "cmake" from CMakeLists.txt files.

You either use cmake, or configure, but not both.

See http://llvm.org/docs/CMake.html on how to use cmake, you should look
at the makefiles that cmake creates,
    
I looked at the llvm I could download, the tarball llvm-2.5.tar.gz, both at the
Makefile that was originally supplied AND the one that's there after you do a
configure. They both have "ifeq" constructs right up at the top of the
Makefile, which are inarguably not BSD Make compatible. They ARE GNU Make
compatible, I don't really understand CMake well enough to comment on that.
Under another email, I described the easiest way to tell if a Makefile is or
isn't BSD/GNU Make compatible.

Here's how to use CMake:

edwin@debian:~/llvm-svn/llvm-obj-cmake$ cmake ~/llvm-svn/llvm
....

And I am able to use the created makefiles by using pmake:
$ pmake
[ 0%] Building CXX object
lib/Support/CMakeFiles/LLVMSupport.dir/ConstantRange.cpp.o
[ 0%] Building CXX object
lib/Support/CMakeFiles/LLVMSupport.dir/Debug.cpp.o
[ 0%] Building CXX object
lib/Support/CMakeFiles/LLVMSupport.dir/Dwarf.cpp.o
[ 0%] Building CXX object
lib/Support/CMakeFiles/LLVMSupport.dir/FileUtilities.cpp.o
[ 0%] Building CXX object
lib/Support/CMakeFiles/LLVMSupport.dir/FoldingSet.cpp.o
[ 1%] Building CXX object
lib/Support/CMakeFiles/LLVMSupport.dir/GraphWriter.cpp.o
[ 1%] Building CXX object
lib/Support/CMakeFiles/LLVMSupport.dir/IsInf.cpp.o
[ 1%] Building CXX object
lib/Support/CMakeFiles/LLVMSupport.dir/IsNAN.cpp.o
[ 1%] Building CXX object
lib/Support/CMakeFiles/LLVMSupport.dir/ManagedStatic.cpp.o
[ 1%] Building CXX object
lib/Support/CMakeFiles/LLVMSupport.dir/MemoryBuffer.cpp.o
[ 1%] Building CXX object
lib/Support/CMakeFiles/LLVMSupport.dir/PluginLoader.cpp.o

I've attached 2 makefiles created by cmake.

Best regards,
--Edwin

Makefile (67.3 KB)

Makefile.2 (39.1 KB)

Chuck Robey wrote:

    

Uh? My FreeBSD installment has `make' and no `gmake'. `make' is indeed
BSD make.
      
In your FreeBSD system, do an "ls -d /var/db/pkg/gmake*" and see if any
directory shows up. If it does, then the only argument you can have is what
name you installed it under, not whether it's there or not, it is. GNU Make,
and NOT BSD Make, will respond to the -v parameter with version info. BSD make
won't do that.

So, to recap, right now LLVM svn builds fine on FreeBSD 7.2 using BSD
`make' with the makefiles generated by cmake.
  

I quickly browsed the CMake 2.6.2 source and their does not seem to be a
special case for BSD in the makefile generator code.
It seems that the makefiles generated by cmake use the subset of
features that is shared by BSD make and GNU make
([Cmake] Problems finding programs on FreeBSD), so
building with either BSD make or GNU make should work.

However, I also noticed that KDE4 uses CMake these days and on a page
(http://techbase.kde.org/Getting_Started/Build/KDE4/FreeBSD) that
describes building on FreeBSD it says "Sometimes, building with *make*
can fail on some modules. You should try using *gmake* instead." So
perhaps YMMV...
    
[snip]

It's NOT possible to make a single Makefile, one that has conditionals in it, be
compatible with both bmake and gmake, because their conditionals don't look
alike. It's possible to produce a bmake or gmake compatible makefile, but I
haven't seen any project do that, actually. Certainly, you can write (for the
autoconf) a Makefile.in that would be compatible with bmake, but I never saw
that actually done, have you?
  

You assume that the makefiles CMake produces need to do some kind of
conditional stuff. I don't think they do anything like that, as that has
already been resolved on a higher level, i.e. with CMake's own little
language used in the CMakeLists.txt files. In fact, the generated
makefiles DO seem to be usable by both GNU make and BSD make.
Here's an example of "the other way around": BSD make on a Gentoo Linux
system building LLVM from CMake-generated makefiles:

23:15|melis@juggle2:~/c/llvm-svn> svn up
U include/llvm/Analysis/ScalarEvolution.h
U tools/bugpoint/CrashDebugger.cpp
U lib/Analysis/ScalarEvolution.cpp
U lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
U lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
U lib/Target/ARM/ARMBuildAttrs.h
U lib/Target/X86/README.txt
U lib/Transforms/Scalar/IndVarSimplify.cpp
Updated to revision 72399.
23:15|melis@juggle2:~/c/llvm-svn> cd ../llvm-svn-build/
23:16|melis@juggle2:~/c/llvm-svn-build> ccmake .
# configure, generate
23:16|melis@juggle2:~/c/llvm-svn-build> gmake -v
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-linux-gnu
23:17|melis@juggle2:~/c/llvm-svn> bmake -v
# checking that this is indeed BSD make, and not GNU make
usage: bmake [-BeikNnqrstWX] [-D variable] [-d flags] [-f makefile]
            [-I directory] [-J private] [-j max_jobs] [-m directory] [-T
file]
            [-V variable] [variable=value] [target ...]
23:17|melis@juggle2:~/c/llvm-svn-build> bmake
[ 6%] Built target LLVMSupport
[ 8%] Built target LLVMSystem
[ 13%] Built target tblgen
[ 13%] Building Intrinsics.gen...
[ 14%] Built target intrinsics_gen
[ 20%] Built target LLVMCore
[ 33%] Built target LLVMCodeGen
Scanning dependencies of target LLVMSelectionDAG
[ 33%] Building CXX object
lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/LegalizeDAG.cpp.o
[ 33%] Building CXX object
lib/CodeGen/SelectionDAG/CMakeFiles/LLVMSelectionDAG.dir/LegalizeVectorOps.cpp.o
Linking CXX static library ../../libLLVMSelectionDAG.a
[ 37%] Built target LLVMSelectionDAG
[ 39%] Built target LLVMAsmPrinter
[ 40%] Built target LLVMBitReader
[ 41%] Built target LLVMBitWriter
Scanning dependencies of target LLVMTransformUtils
[ 41%] Building CXX object
lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/LCSSA.cpp.o
Linking CXX static library ../../libLLVMTransformUtils.a
[ 47%] Built target LLVMTransformUtils
etc...

So when using CMake you only need to know ITS configuration file syntax
and none of the GNU make/BSD make stuff.
That's the whole point of CMake: giving you a high-level cross-platform
build environment that hides the actual build tools used (make on
Unices, Visual Studio on Windows, etc).

Regards,
Paul

@Chuck Robey

Before you pass judgment on CMake quit using those existing makefiles or the configure scripts. They are NOT GENERATED BY CMAKE. Start by downloading CMAKE from http://cmake.org/ and continue the process outlined in the build instructions that we keep trying to tell you to use and you keep ignoring completely.

Perhaps you didn't understand what I said earlier when I said we are TRANSITIONING AWAY from AUTOTOOLS/CONFIGURE. They are still present in the build because the transition away from them isn't complete yet. CMake doesn't require those files at all since it does its thing totally differently.

:frowning: Kinda sad. I can't imagine that this isn't trivial. Doesn't inspire confidence...

Mike Stump <mrs@apple.com> writes:

Paul Melis <llvm@assumetheposition.nl> writes:

Is the current support in CMake for generating makefiles with
relative
paths not good enough?

No. And the cmake people think there is no easy fix.

:frowning: Kinda sad. I can't imagine that this isn't trivial. Doesn't
inspire confidence...

It is far from trivial. To begin with, think that a fundamental part of
cmake's work before makefile generation consists on locating libraries,
executables, etc required for the build. This is like saying that, if
you release the source code with makefiles generated by cmake, you are
releasing it after the config step (using autotools parlance). Added to
this, some build tools (mostly IDEs) dislike relative paths on some
settings.

After giving some thought to the problem, I concur with the cmake devs:
there is no foolproof solution.

We need to wait until cmake is accepted as just one more tool on the
standard toolset. This can require a long time on some
environments. OTOH, I can't think of any serious user ditching LLVM
because he refuses to use cmake.

There are organizations where inter-department issues are the real
blocker, though. The old Visual Studio project files are still there
because of this "don't impose more requirements on us" actitude from one
department towards another on one organization that uses LLVM.

Ok, so be it; that's logically a separate problem. For example, there are some users that would be fine to completely wire down (port config, if you will) everything, well, every thing except where the source tree (and the build tree) are located.