Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2015-05-20 Thread Brad King
On 03/13/2015 12:20 PM, Ulf Wetzker wrote:
 The files contain bad internal filenames.

 CMake Error at /usr/share/llvm-3.5/cmake/LLVMConfig.cmake:43 (include):
   include could not find load file:

 /usr/lib/llvm-3.5/share/llvm/cmake/LLVMExports.cmake
 
 In LLVMConfig.cmake the variable ${LLVM_CMAKE_DIR} is set to 
 /usr/lib/llvm-3.5/share/llvm/cmake. While trying to include 
 LLVMExports.cmake from ${LLVM_CMAKE_DIR} this error it thrown since 
 LLVMConfig.cmake and LLVMExports.cmake are both located in 
 /usr/share/llvm-3.5/cmake/

The original issue has been addressed upstream.  This new error is
caused by how Debian packaging modifies the installation layout.
I've reported this as a separate issue:

 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=785931

-Brad


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2015-03-13 Thread Ulf Wetzker
On 06/03/2014 01:49 PM, Sylvestre Ledru wrote:
 The files contain bad internal filenames.  For example, if you try to build
 an LLVM pass according to the LLVM instructions
 http://llvm.org/docs/CMake.html#cmake-out-of-source-pass
 it will give the error
 
 CMake Error at /usr/share/llvm-3.5/cmake/LLVMConfig.cmake:43 (include):
include could not find load file:
 
  /usr/lib/llvm-3.5/share/llvm/cmake/LLVMExports.cmake
 
 
 where we can see it is looking in the folder
 /usr/lib/llvm-3.5/share/llvm/cmake/, instead of /usr/share/llvm-3.5/cmake/
 where the file LLVMExports.cmake is actually located.

In LLVMConfig.cmake the variable ${LLVM_CMAKE_DIR} is set to 
/usr/lib/llvm-3.5/share/llvm/cmake. While trying to include 
LLVMExports.cmake from ${LLVM_CMAKE_DIR} this error it thrown since 
LLVMConfig.cmake and LLVMExports.cmake are both located in 
/usr/share/llvm-3.5/cmake/

I fixed this by looking for the include files relative to the config file.
include(${CMAKE_CURRENT_LIST_DIR}/LLVMExports.cmake)

I think this patch will fix the the error caused by calling
find_package(LLVM REQUIRED CONFIG)

Ulf--- LLVMConfig.cmake	2015-02-27 19:00:40.0 +0100
+++ LLVMConfig.cmake	2015-03-13 16:48:28.227264517 +0100
@@ -43,14 +43,13 @@
 set(LLVM_INCLUDE_DIRS /usr/lib/llvm-3.5/include)
 set(LLVM_LIBRARY_DIRS /usr/lib/llvm-3.5/lib)
 set(LLVM_DEFINITIONS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS)
-set(LLVM_CMAKE_DIR /usr/lib/llvm-3.5/share/llvm/cmake)
 set(LLVM_TOOLS_BINARY_DIR /usr/lib/llvm-3.5/bin)
 
 if(NOT TARGET LLVMSupport)
-  include(${LLVM_CMAKE_DIR}/LLVMExports.cmake)
+  include(${CMAKE_CURRENT_LIST_DIR}/LLVMExports.cmake)
 endif()
 
-include(${LLVM_CMAKE_DIR}/LLVM-Config.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/LLVM-Config.cmake)
 set_property(GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_LLVMSupport )
 set_property(GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_LLVMAArch64Utils LLVMSupport)
 set_property(GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_LLVMMC LLVMSupport)


Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-06-03 Thread Jeremy Salwen
I think there are still problems with the CMake files installed by the
Debian packages at http://llvm.org/apt/.  While it does install the files
listed

$ dpkg -c llvm-3.5-dev_1%3a3.5~svn210093-1~exp1_amd64.deb |grep cmake
 drwxr-xr-x root/root 0 2014-06-03 06:57 ./usr/share/llvm-3.5/cmake/
 -rw-r--r-- root/root  1223 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/HandleLLVMStdlib.cmake
 -rw-r--r-- root/root  5550 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/TableGen.cmake
 -rw-r--r-- root/root 17272 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/HandleLLVMOptions.cmake
 -rw-r--r-- root/root  3162 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/LLVMParseArguments.cmake
 -rw-r--r-- root/root   492 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/AddLLVMDefinitions.cmake
 -rw-r--r-- root/root  1064 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/GetSVN.cmake
 -rw-r--r-- root/root 13863 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/LLVMExports.cmake
 -rw-r--r-- root/root 13290 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/LLVMConfig.cmake
 -rw-r--r-- root/root   846 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/FindSphinx.cmake
 -rw-r--r-- root/root  2224 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/LLVMProcessSources.cmake
 -rw-r--r-- root/root  3900 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/ChooseMSVCCRT.cmake
 -rw-r--r-- root/root 23319 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/AddLLVM.cmake
 -rw-r--r-- root/root  6645 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/LLVM-Config.cmake
 -rw-r--r-- root/root  2268 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/AddSphinxTarget.cmake
 -rw-r--r-- root/root   445 2014-06-03 06:56
 ./usr/share/llvm-3.5/cmake/LLVMConfigVersion.cmake



The files contain bad internal filenames.  For example, if you try to build
an LLVM pass according to the LLVM instructions
http://llvm.org/docs/CMake.html#cmake-out-of-source-pass
it will give the error

CMake Error at /usr/share/llvm-3.5/cmake/LLVMConfig.cmake:43 (include):
   include could not find load file:

 /usr/lib/llvm-3.5/share/llvm/cmake/LLVMExports.cmake


where we can see it is looking in the folder
/usr/lib/llvm-3.5/share/llvm/cmake/, instead of /usr/share/llvm-3.5/cmake/
where the file LLVMExports.cmake is actually located.

Jeremy


Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-02-22 Thread Sylvestre Ledru
On 20/02/2014 14:05, Brad King wrote:
 On 02/19/2014 04:54 PM, Sylvestre Ledru wrote:
 this patch fixes it. I will upload it when I have more stuff to upload
 (except if you need it soon)
 Thanks.  I will wait for the next update and then try it again.

 -Brad

I forgot to mention but the packages on http://llvm.org/apt/ contains
the fix now ;)
$ dpkg -c llvm-3.5-dev_3.5~svn201889-1~exp1_amd64.deb|grep cmake
drwxr-xr-x root/root 0 2014-02-22 03:24 ./usr/share/llvm-3.5/cmake/
-rw-r--r-- root/root 13729 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/LLVMExports.cmake
-rw-r--r-- root/root  7073 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/LLVM-Config.cmake
-rw-r--r-- root/root 13218 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/LLVMConfig.cmake
-rw-r--r-- root/root  3162 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/LLVMParseArguments.cmake
-rw-r--r-- root/root  3900 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/ChooseMSVCCRT.cmake
-rw-r--r-- root/root26 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/LLVMConfigVersion.cmake
-rw-r--r-- root/root  2224 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/LLVMProcessSources.cmake
-rw-r--r-- root/root 15120 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/HandleLLVMOptions.cmake
-rw-r--r-- root/root  5478 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/TableGen.cmake
-rw-r--r-- root/root  1223 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/HandleLLVMStdlib.cmake
-rw-r--r-- root/root  1064 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/GetSVN.cmake
-rw-r--r-- root/root   492 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/AddLLVMDefinitions.cmake
-rw-r--r-- root/root 22980 2014-02-22 03:22
./usr/share/llvm-3.5/cmake/AddLLVM.cmake

well done ;)

S


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-02-20 Thread Brad King
On 02/19/2014 04:54 PM, Sylvestre Ledru wrote:
 this patch fixes it. I will upload it when I have more stuff to upload
 (except if you need it soon)

Thanks.  I will wait for the next update and then try it again.

-Brad


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-02-19 Thread Brad King
On 02/14/2014 12:41 PM, Sylvestre Ledru wrote:
 I just uploaded a new snapshot release of llvm with your changes.

Thanks.  However, the files still do not appear as of 1:3.5~svn201412-1.
I downloaded the package source and it does have the changes to the
Makefile rules but the files still do not seem to be installed.  Does
the packaging config file debian/llvm-3.5-dev.install line:

 cmake/modules/*.cmake   usr/share/llvm-3.5/cmake/

influence this?  The missing modules appear in the build tree here:

 cmake/modules/LLVMConfig.cmake
 cmake/modules/LLVMConfigVersion.cmake
 cmake/modules/LLVMExports.cmake

The make install rules install the needed modules from both the
build and source trees when building with configure+make by hand
but I have not tried building the debian package from source.

-Brad


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-02-19 Thread Sylvestre Ledru
On 19/02/2014 15:49, Brad King wrote:
 On 02/14/2014 12:41 PM, Sylvestre Ledru wrote:
 I just uploaded a new snapshot release of llvm with your changes.
 Thanks.  However, the files still do not appear as of 1:3.5~svn201412-1.
 I downloaded the package source and it does have the changes to the
 Makefile rules but the files still do not seem to be installed.  Does
 the packaging config file debian/llvm-3.5-dev.install line:

  cmake/modules/*.cmake   usr/share/llvm-3.5/cmake/

 influence this?  The missing modules appear in the build tree here:

  cmake/modules/LLVMConfig.cmake
  cmake/modules/LLVMConfigVersion.cmake
  cmake/modules/LLVMExports.cmake

 The make install rules install the needed modules from both the
 build and source trees when building with configure+make by hand
 but I have not tried building the debian package from source.


Hmm, that is surprising. I just restarted a build to check that.

After the build/make install, I have:
# ls -1 debian/llvm-3.5-dev/usr/share/llvm-3.5/cmake/
AddLLVM.cmake
AddLLVMDefinitions.cmake
CheckAtomic.cmake
ChooseMSVCCRT.cmake
GetHostTriple.cmake
GetSVN.cmake
HandleLLVMOptions.cmake
HandleLLVMStdlib.cmake
LLVM-Config.cmake
LLVMParseArguments.cmake
LLVMProcessSources.cmake
TableGen.cmake
VersionFromVCS.cmake

but in the package, after the files are supposed to be moved, I get:

 ls -1 ./debian/tmp/usr/lib/llvm-3.5/share/llvm/cmake/
AddLLVM.cmake
AddLLVMDefinitions.cmake
ChooseMSVCCRT.cmake
GetSVN.cmake
HandleLLVMOptions.cmake
HandleLLVMStdlib.cmake
LLVM-Config.cmake
LLVMConfig.cmake
LLVMConfigVersion.cmake
LLVMExports.cmake
LLVMParseArguments.cmake
LLVMProcessSources.cmake
TableGen.cmake


# ls -1 build-llvm/cmake/modules/
LLVMBuildExports.cmake
LLVMConfig.cmake
LLVMConfigVersion.cmake
LLVMExports.cmake
Makefile
= That might be the cause but I am not sure why. (maybe dh_install is
confused because there are two

 cmake/modules/*.cmake)



I am sick today :/ So, I won't spend too much time on this (it would be
wasted) but I will have a look. That is an interesting issue (or please
go ahead).

Thanks again for your work. It is great (and I am looking forward to
switch to cmake)

S


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-02-19 Thread Sylvestre Ledru
On 19/02/2014 15:49, Brad King wrote:
 On 02/14/2014 12:41 PM, Sylvestre Ledru wrote:
 I just uploaded a new snapshot release of llvm with your changes.
 Thanks.  However, the files still do not appear as of 1:3.5~svn201412-1.
 I downloaded the package source and it does have the changes to the
 Makefile rules but the files still do not seem to be installed.  Does
 the packaging config file debian/llvm-3.5-dev.install line:

  cmake/modules/*.cmake   usr/share/llvm-3.5/cmake/

 influence this?  The missing modules appear in the build tree here:

  cmake/modules/LLVMConfig.cmake
  cmake/modules/LLVMConfigVersion.cmake
  cmake/modules/LLVMExports.cmake

 The make install rules install the needed modules from both the
 build and source trees when building with configure+make by hand
 but I have not tried building the debian package from source.

 -Brad

this patch fixes it. I will upload it when I have more stuff to upload
(except if you need it soon)

Index: llvm-3.5-dev.install
===
--- llvm-3.5-dev.install(révision 1110)
+++ llvm-3.5-dev.install(copie de travail)
@@ -4,7 +4,8 @@
 usr/lib/llvm-3.5/lib/libLTO.*
 usr/lib/llvm-3.5/include/llvm/  usr/include/llvm-3.5/
 usr/lib/llvm-3.5/include/llvm-c/usr/include/llvm-c-3.5/
-cmake/modules/*.cmake   usr/share/llvm-3.5/cmake/
+# Explicit debian/tmp since there are multiple declarations
+debian/tmp/usr/lib/llvm-3.5/share/llvm/cmake/*.cmake
usr/share/llvm-3.5/cmake/
 
 build-llvm/Makefile.common/usr/lib/llvm-3.5/build/
 build-llvm/Makefile.config/usr/lib/llvm-3.5/build/


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-02-14 Thread Sylvestre Ledru
On 10/02/2014 19:28, Brad King wrote:
 On 01/24/2014 03:47 PM, Brad King wrote:
 I've prepared a more general-purpose series and posted it
 for upstream review on llvm-commits
 The series has been applied upstream trunk as of r201053:

  http://thread.gmane.org/gmane.comp.compilers.llvm.cvs/173517/focus=175229

 This issue should be automatically resolved when a version
 containing that change is released and packaged.


Excellent and congrat! I just uploaded a new snapshot release of llvm
with your changes.
However, it needs approval since I introduced a new package. So, it
should be available in a few
hours.

Sylvestre


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-02-10 Thread Brad King
On 01/24/2014 03:47 PM, Brad King wrote:
 I've prepared a more general-purpose series and posted it
 for upstream review on llvm-commits

The series has been applied upstream trunk as of r201053:

 http://thread.gmane.org/gmane.comp.compilers.llvm.cvs/173517/focus=175229

This issue should be automatically resolved when a version
containing that change is released and packaged.

-Brad


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-01-24 Thread Brad King
On 01/22/2014 10:54 AM, Sylvestre Ledru wrote:
 wahou, that is excellent. Thanks!
 Are you going to submit them upstream ?
 (I can apply them if you need a contact).

I've prepared a more general-purpose series and posted it
for upstream review on llvm-commits:

 http://thread.gmane.org/gmane.comp.compilers.llvm.cvs/173517

Thanks,
-Brad


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-01-23 Thread Brad King
On 01/22/2014 09:46 PM, Sylvestre Ledru wrote:
 Beside:
 +# TODO: De-duplicate target lists w.r.t. 'autoconf/configure.ac'
[snip]
 It sounds good.  Could you see to fix that?

Since that requires re-running autoconf I went ahead and took care
of the other AC_SUBST updates too.  Updated patch 2 attached.

Note now that the version components go through AC_SUBST this
patch will conflict in autoconf/configure.ac when moved between
versions of LLVM.  I built it on top of 3.4.

This must be followed up by a patch to 'configure' made by running
autoconf/AutoRegen.sh.  However, I do not have the versions of
the autotools required by that script so the 'configure' generated
on my machine for local testing is not suitable for distribution.

Thanks,
-Brad

From 83cb7d3898947b7b38eaf6960a3b0022bf0c7266 Mon Sep 17 00:00:00 2001
Message-Id: 83cb7d3898947b7b38eaf6960a3b0022bf0c7266.1390495723.git.brad.k...@kitware.com
In-Reply-To: 52e08268.2090...@debian.org
References: 52e08268.2090...@debian.org
From: Brad King brad.k...@kitware.com
Date: Wed, 22 Jan 2014 10:00:50 -0500
Subject: [PATCH] Makefile: Build and install CMake package modules

Teach the Makefile build system to generate and install modules
LLVMConfig.cmake and LLVMConfigVersion.cmake so that applications that
build with CMake can use 'find_package(LLVM)' even when LLVM is not
built with CMake.  These modules tell such applications about available
LLVM libraries and their dependencies.

Run llvm-config to generate the list of libraries and use the results
of LLVMBuild to generate the library dependencies.  Use sed to perform
substitutions in the LLVMConfig.cmake.in and LLVMConfigVersion.cmake.in
sources that our CMake build system uses.

Teach autoconf/configure.ac to AC_SUBST several new values that we need.
---
 Makefile|  4 +-
 Makefile.config.in  | 15 
 Makefile.rules  | 15 +---
 autoconf/configure.ac   | 24 +---
 autoconf/m4/define_subst.m4 |  5 +++
 cmake/Makefile  | 12 ++
 cmake/modules/Makefile  | 90 +
 7 files changed, 152 insertions(+), 13 deletions(-)
 create mode 100644 autoconf/m4/define_subst.m4
 create mode 100644 cmake/Makefile
 create mode 100644 cmake/modules/Makefile

diff --git a/Makefile b/Makefile
index e3672b7..e38cc6d 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ LEVEL := .
 #   3. Build IR, which builds the Intrinsics.inc file used by libs.
 #   4. Build libs, which are needed by llvm-config.
 #   5. Build llvm-config, which determines inter-lib dependencies for tools.
-#   6. Build tools and docs.
+#   6. Build tools, docs, and cmake modules.
 #
 # When cross-compiling, there are some things (tablegen) that need to
 # be build for the build system first.
@@ -31,7 +31,7 @@ ifeq ($(BUILD_DIRS_ONLY),1)
   OPTIONAL_DIRS := tools/clang/utils/TableGen
 else
   DIRS := lib/Support lib/TableGen utils lib/IR lib tools/llvm-shlib \
-  tools/llvm-config tools docs unittests
+  tools/llvm-config tools docs cmake unittests
   OPTIONAL_DIRS := projects bindings
 endif
 
diff --git a/Makefile.config.in b/Makefile.config.in
index dcca45f..7633be2 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -15,6 +15,8 @@
 # Define LLVM specific info and directories based on the autoconf variables
 LLVMPackageName   := @PACKAGE_TARNAME@
 LLVMVersion   := @PACKAGE_VERSION@
+LLVM_VERSION_MAJOR := @LLVM_VERSION_MAJOR@
+LLVM_VERSION_MINOR := @LLVM_VERSION_MINOR@
 LLVM_CONFIGTIME   := @LLVM_CONFIGTIME@
 
 ###
@@ -118,6 +120,7 @@ HOST_ARCH=@HOST_ARCH@
 # Target hardware architecture
 ARCH=@ARCH@
 TARGET_NATIVE_ARCH := $(ARCH)
+LLVM_NATIVE_ARCH := @LLVM_NATIVE_ARCH@
 
 # Indicates, whether we're cross-compiling LLVM or not
 LLVM_CROSS_COMPILING=@LLVM_CROSS_COMPILING@
@@ -207,13 +210,22 @@ POD2MAN:= @POD2MAN@
 PDFROFF:= @PDFROFF@
 ZIP:= @ZIP@
 
+HAVE_LIBZ  := @HAVE_LIBZ@
+HAVE_DLOPEN := @HAVE_DLOPEN@
 HAVE_PTHREAD := @HAVE_PTHREAD@
+HAVE_TERMINFO := @HAVE_TERMINFO@
 
 LIBS   := @LIBS@
 
+# Targets that are possible to build
+ALL_TARGETS := @ALL_TARGETS@
+
 # Targets that we should build
 TARGETS_TO_BUILD=@TARGETS_TO_BUILD@
 
+# Targets supporting JIT
+TARGETS_WITH_JIT := @TARGETS_WITH_JIT@
+
 # Path to directory where object files should be stored during a build.
 # Set OBJ_ROOT to . if you do not want to use a separate place for
 # object files.
@@ -250,6 +262,9 @@ ENABLE_CLANG_STATIC_ANALYZER = @ENABLE_CLANG_STATIC_ANALYZER@
 # When ENABLE_WERROR is enabled, we'll pass -Werror on the command line
 ENABLE_WERROR = @ENABLE_WERROR@
 
+# When ENABLE_TERMINFO is enabled, we use terminfo.
+ENABLE_TERMINFO = @ENABLE_TERMINFO@
+
 # When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
 # into the Release directories. Otherwise, LLVM code is not optimized and
 # output is put in the Debug 

Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-01-22 Thread Brad King
On 01/18/2014 10:54 AM, Sylvestre Ledru wrote:
 Maybe there is a way to generate this file with the autotools?

Yes, and here are patches to do so.

I built these on top of the 3.4 release:

 llvm/branches/release_34@197944

They also correctly work on top of a recent trunk:

 llvm/trunk@199058

They should work for r197556.

The latter patch contains some hacks to avoid re-running
autoconf so it can be simplified if it goes upstream as
noted in the TODO comments.

-Brad

From deeda6e64171bff53b96d6d32f54f4741b1a0da9 Mon Sep 17 00:00:00 2001
Message-Id: deeda6e64171bff53b96d6d32f54f4741b1a0da9.1390405404.git.brad.k...@kitware.com
In-Reply-To: 52daa3d3.8030...@debian.org
References: 52daa3d3.8030...@debian.org
From: Brad King brad.k...@kitware.com
Date: Tue, 21 Jan 2014 09:50:53 -0500
Subject: [PATCH 1/2] Simplify LLVMConfig.cmake inclusion of LLVM-Config module

The LLVMConfig.cmake file we generate already hard-codes include and lib
paths under the install prefix and therefore works only from the install
tree.  Simply include LLVM-Config from the location it is known to be
installed.  In the future we could configure a separate LLVMConfig.cmake
to work in the build tree.
---
 cmake/modules/LLVMConfig.cmake.in | 14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/cmake/modules/LLVMConfig.cmake.in b/cmake/modules/LLVMConfig.cmake.in
index 68fe296..32d1c7f 100644
--- a/cmake/modules/LLVMConfig.cmake.in
+++ b/cmake/modules/LLVMConfig.cmake.in
@@ -43,16 +43,4 @@ set(LLVM_INCLUDE_DIRS ${LLVM_INSTALL_PREFIX}/include)
 set(LLVM_LIBRARY_DIRS ${LLVM_INSTALL_PREFIX}/lib)
 set(LLVM_DEFINITIONS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS)
 
-# We try to include using the current setting of CMAKE_MODULE_PATH,
-# which suppossedly was filled by the user with the directory where
-# this file was installed:
-include( LLVM-Config OPTIONAL RESULT_VARIABLE LLVMCONFIG_INCLUDED )
-
-# If failed, we assume that this is an un-installed build:
-if( NOT LLVMCONFIG_INCLUDED )
-  set(CMAKE_MODULE_PATH
-${CMAKE_MODULE_PATH}
-@LLVM_SOURCE_DIR@/cmake/modules)
-  include( LLVM-Config )
-endif()
-
+include(${LLVM_INSTALL_PREFIX}/share/llvm/cmake/LLVM-Config.cmake)
-- 
1.8.5.2

From b9ac38eeed2946b61c3e0d63c0510129cf677a21 Mon Sep 17 00:00:00 2001
Message-Id: b9ac38eeed2946b61c3e0d63c0510129cf677a21.1390405404.git.brad.k...@kitware.com
In-Reply-To: 52daa3d3.8030...@debian.org
References: 52daa3d3.8030...@debian.org
From: Brad King brad.k...@kitware.com
Date: Wed, 22 Jan 2014 10:00:50 -0500
Subject: [PATCH 2/2] Makefile: Build and install CMake package modules

Teach the Makefile build system to generate and install modules
LLVMConfig.cmake and LLVMConfigVersion.cmake so that applications that
build with CMake can use 'find_package(LLVM)' even when LLVM is not
built with CMake.  These modules tell such applications about available
LLVM libraries and their dependencies.

Run llvm-config to generate the list of libraries and use the results
of LLVMBuild to generate the library dependencies.  Use sed to perform
substitutions in the LLVMConfig.cmake.in and LLVMConfigVersion.cmake.in
sources that our CMake build system uses.

Several values that we need are not AC_SUBST'd by autoconf/configure.ac
so parse them out of include/llvm/Config/config.h for now and leave TODO
comments.
---
 Makefile   |   4 +-
 Makefile.config.in |   1 +
 Makefile.rules |  15 ---
 cmake/Makefile |  12 ++
 cmake/modules/Makefile | 103 +
 5 files changed, 128 insertions(+), 7 deletions(-)
 create mode 100644 cmake/Makefile
 create mode 100644 cmake/modules/Makefile

diff --git a/Makefile b/Makefile
index e3672b7..e38cc6d 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ LEVEL := .
 #   3. Build IR, which builds the Intrinsics.inc file used by libs.
 #   4. Build libs, which are needed by llvm-config.
 #   5. Build llvm-config, which determines inter-lib dependencies for tools.
-#   6. Build tools and docs.
+#   6. Build tools, docs, and cmake modules.
 #
 # When cross-compiling, there are some things (tablegen) that need to
 # be build for the build system first.
@@ -31,7 +31,7 @@ ifeq ($(BUILD_DIRS_ONLY),1)
   OPTIONAL_DIRS := tools/clang/utils/TableGen
 else
   DIRS := lib/Support lib/TableGen utils lib/IR lib tools/llvm-shlib \
-  tools/llvm-config tools docs unittests
+  tools/llvm-config tools docs cmake unittests
   OPTIONAL_DIRS := projects bindings
 endif
 
diff --git a/Makefile.config.in b/Makefile.config.in
index dcca45f..2d8d613 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -207,6 +207,7 @@ POD2MAN:= @POD2MAN@
 PDFROFF:= @PDFROFF@
 ZIP:= @ZIP@
 
+HAVE_LIBZ  := @HAVE_LIBZ@
 HAVE_PTHREAD := @HAVE_PTHREAD@
 
 LIBS   := @LIBS@
diff --git a/Makefile.rules b/Makefile.rules
index 68f6cf8..0355ca7 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -78,6 +78,10 @@ LLVMBuildTool	:= 

Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-01-22 Thread Sylvestre Ledru
On 22/01/2014 16:49, Brad King wrote:
 On 01/18/2014 10:54 AM, Sylvestre Ledru wrote:
 Maybe there is a way to generate this file with the autotools?
 Yes, and here are patches to do so.


wahou, that is excellent. Thanks!
Are you going to submit them upstream ? (I can apply them if you need a
contact).

I will apply your patch in the new few days.

Cheers,
Sylvestre


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-01-22 Thread Sylvestre Ledru
On 22/01/2014 07:49, Brad King wrote:
 On 01/18/2014 10:54 AM, Sylvestre Ledru wrote:
 Maybe there is a way to generate this file with the autotools?
 Yes, and here are patches to do so.

 I built these on top of the 3.4 release:

  llvm/branches/release_34@197944

 They also correctly work on top of a recent trunk:

  llvm/trunk@199058

 They should work for r197556.

 The latter patch contains some hacks to avoid re-running
 autoconf so it can be simplified if it goes upstream as
 noted in the TODO comments.

 -Brad
Beside:
+# TODO: De-duplicate target lists w.r.t. 'autoconf/configure.ac'
+LLVM_TARGETS_WITH_JIT := AArch64 ARM Mips PowerPC SystemZ X86
+LLVM_ALL_TARGETS := AArch64 ARM CppBackend Hexagon Mips MSP430 NVPTX
PowerPC R
600 Sparc SystemZ X86 XCore

It sounds good.
Could you see to fix that?

thanks,
S


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-01-18 Thread Sylvestre Ledru
Hello,

On 16/01/2014 19:03, Brad King wrote:
 are not installed.  These files are:

  LLVMConfig.cmake= package configuration file
  LLVMConfigVersion.cmake = package version file

 They are produced during the CMake configuration process for building
 LLVM itself.  Their purpose is to hold information about what was built
 and where it is installed.
Yes but I am not building with CMake for now ...
I am not planning to switch until most of the issues reported in this
bug are fixed:
http://llvm.org/bugs/show_bug.cgi?id=15732

Maybe there is a way to generate this file with the autotools?


Sorry,
Sylvestre


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#735592: llvm-3.5-dev: LLVM/Clang CMake package files missing

2014-01-16 Thread Brad King
Package: llvm-3.5-dev
Version: 1:3.5~svn197556-1
Severity: normal

Dear Maintainer,

The issue reported in archived bug #701153 is not fully resolved.
The main problem still exists as of llvm-3.5-dev 1:3.5~svn197556-1.

The cmake/modules/*.cmake files from the llvm source are installed
including a file called LLVM-Config.cmake.  However, the files
needed to use CMake to build against LLVM as documented here:

 http://llvm.org/docs/CMake.html#embedding-llvm-in-your-project

are not installed.  These files are:

 LLVMConfig.cmake= package configuration file
 LLVMConfigVersion.cmake = package version file

They are produced during the CMake configuration process for building
LLVM itself.  Their purpose is to hold information about what was built
and where it is installed.

Note that LLVM-Config.cmake is *not* the same as LLVMConfig.cmake.
The former is a module that upstream authors wrote to contain some
CMake-language API code.  The latter is a CMake package configuration
file that is located and loaded by applications using

 find_package(LLVM)

or

 find_package(LLVM CONFIG REQUIRED)

in their CMake code as shown in the LLVM documentation.  Without the
missing files the applications fail to build with errors like that
shown below.

-Brad


CMake Error at CMakeLists.txt:36 (find_package):
  Could not find a package configuration file provided by LLVM with any of
  the following names:

LLVMConfig.cmake
llvm-config.cmake

  Add the installation prefix of LLVM to CMAKE_PREFIX_PATH or set
  LLVM_DIR to a directory containing one of the above files.  If LLVM
  provides a separate development package or SDK, be sure it has been
  installed.

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (900, 'testing'), (50, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.12-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages llvm-3.5-dev depends on:
ii  libc6  2.17-97
ii  libcloog-isl4  0.18.1-3
ii  libffi-dev 3.0.13-4
ii  libffi63.0.13-4
ii  libgcc11:4.8.2-10
ii  libgmp10   2:5.1.3+dfsg-1
ii  libisl10   0.12.1-2
ii  libjsoncpp00.6.0~rc2-3
ii  libllvm3.5 1:3.5~svn197556-1
ii  libstdc++6 4.8.2-10
ii  libtinfo-dev   5.9+20130608-1
ii  libtinfo5  5.9+20130608-1
ii  llvm-3.5   1:3.5~svn197556-1

llvm-3.5-dev recommends no packages.

llvm-3.5-dev suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org