You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Beuchat José <Jo...@sisltd.ch> on 2007/04/24 16:52:35 UTC

Maven native plugin

Hello, 

 

I want to use the maven "native plugin" to compile C++ project. The compilator is ok, but I've problems with the libraries. 

 

Here the error message: 

 

D:\MavenTests\my-app>mvn package

[INFO] Scanning for projects...

[INFO] ----------------------------------------------------------------------------

[INFO] Building my-app

[INFO]    task-segment: [package]

[INFO] ----------------------------------------------------------------------------

[INFO] [native:initialize]

[INFO] [native:compile]

[INFO] icl -ID:\MavenTests\my-app\src\main\native -o D:\MavenTests\my-app\target\test.

obj -c D:\MavenTests\my-app\src\main\native\test.cpp

Intel(R) C++ Compiler for 32-bit applications, Version 9.1    Build 20060706Z Package

ID: W_CC_C_9.1.028

Copyright (C) 1985-2006 Intel Corporation.  All rights reserved.

 

test.cpp

D:\MavenTests\my-app\src\main\native\test.cpp(1): catastrophic error: could not open s

ource file "iostream"

  #include <iostream>

                     ^

 

compilation aborted for D:\MavenTests\my-app\src\main\native\test.cpp (code 4)

[INFO] ------------------------------------------------------------------------

[ERROR] BUILD ERROR

[INFO] ------------------------------------------------------------------------

[INFO] Error executing command line. Exit code:4

 

[INFO] ------------------------------------------------------------------------

[INFO] For more information, run Maven with the -e switch

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 2 seconds

[INFO] Finished at: Tue Apr 24 16:51:47 CEST 2007

[INFO] Final Memory: 4M/9M

[INFO] ------------------------------------------------------------------------

 

 

 

 

 

 

 

Could you help me? Or give me an example of the pom.xml file with specified libraries?

 

Sincerely 

 

Beuchat José

Informatiker

ISS AG

Allmendstrasse 11

CH - 2563 Port / Schweiz

Jose.Beuchat@iss-ag.ch

 


Re: Maven native plugin

Posted by Dan Tran <da...@gmail.com>.
did you setup environemnt ? like INCLUDE, LIB ?

-D


On 4/24/07, Beuchat José <Jo...@sisltd.ch> wrote:
>
> Hello,
>
>
>
> I want to use the maven "native plugin" to compile C++ project. The
> compilator is ok, but I've problems with the libraries.
>
>
>
> Here the error message:
>
>
>
> D:\MavenTests\my-app>mvn package
>
> [INFO] Scanning for projects...
>
> [INFO]
> ----------------------------------------------------------------------------
>
> [INFO] Building my-app
>
> [INFO]    task-segment: [package]
>
> [INFO]
> ----------------------------------------------------------------------------
>
> [INFO] [native:initialize]
>
> [INFO] [native:compile]
>
> [INFO] icl -ID:\MavenTests\my-app\src\main\native -o
> D:\MavenTests\my-app\target\test.
>
> obj -c D:\MavenTests\my-app\src\main\native\test.cpp
>
> Intel(R) C++ Compiler for 32-bit applications, Version 9.1    Build
> 20060706Z Package
>
> ID: W_CC_C_9.1.028
>
> Copyright (C) 1985-2006 Intel Corporation.  All rights reserved.
>
>
>
> test.cpp
>
> D:\MavenTests\my-app\src\main\native\test.cpp(1): catastrophic error:
> could not open s
>
> ource file "iostream"
>
> #include <iostream>
>
>                     ^
>
>
>
> compilation aborted for D:\MavenTests\my-app\src\main\native\test.cpp
> (code 4)
>
> [INFO]
> ------------------------------------------------------------------------
>
> [ERROR] BUILD ERROR
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] Error executing command line. Exit code:4
>
>
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] For more information, run Maven with the -e switch
>
> [INFO]
> ------------------------------------------------------------------------
>
> [INFO] Total time: 2 seconds
>
> [INFO] Finished at: Tue Apr 24 16:51:47 CEST 2007
>
> [INFO] Final Memory: 4M/9M
>
> [INFO]
> ------------------------------------------------------------------------
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Could you help me? Or give me an example of the pom.xml file with
> specified libraries?
>
>
>
> Sincerely
>
>
>
> Beuchat José
>
> Informatiker
>
> ISS AG
>
> Allmendstrasse 11
>
> CH - 2563 Port / Schweiz
>
> Jose.Beuchat@iss-ag.ch
>
>
>
>

Re: Maven native plugin

Posted by Holger Hoffstaette <ho...@wizards.de>.
On Wed, 09 May 2007 16:32:25 +0200, Lukas Theussl wrote:

> MPNATIVE is the issue tracker for the maven 1 native plugin, which is not
> developed anymore. If you meant to open an issue for the m2 plugin, you
> should do it at MOJO, under the native component.

Argh! Thanks a lot for the tip. I filed a new one at
http://jira.codehaus.org/browse/MOJO-790

thanks!
Holger



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven native plugin

Posted by Lukas Theussl <lt...@apache.org>.
MPNATIVE is the issue tracker for the maven 1 native plugin, which is 
not developed anymore. If you meant to open an issue for the m2 plugin, 
you should do it at MOJO, under the native component.

-Lukas


Holger Hoffstaette wrote:
> Guys,
> 
> Everybody interested in more flexible CFLAGS/library path settings should
> vote for http://jira.codehaus.org/browse/MPNATIVE-22 :-)
> 
> -h
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Maven native plugin

Posted by Holger Hoffstaette <ho...@wizards.de>.
Guys,

Everybody interested in more flexible CFLAGS/library path settings should
vote for http://jira.codehaus.org/browse/MPNATIVE-22 :-)

-h



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Maven native plugin

Posted by Sean Hennessy <sh...@astutenetworks.com>.
To expand on this..
Given the following command line options defined for the compiler;
-idirafterdir  Add directory (dir) to the second include file search
path (after -I). 
-Idirectory   Specifies an additional directory  to search for include
files 
-Ldirectory   Instruct linker to search directory for libraries 

one would modify the sample pom and adjust the start, middle and end
options of the compiler and linker
as required or suggested by output.

Good luck,



<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<packaging>so</packaging>
<version>1.0-SNAPSHOT</version>
<name>my-app</name>
<url>http://maven.apache.org</url>
<dependencies>
   <dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <version>3.8.1</version>
     <scope>test</scope>
   </dependency>
</dependencies>
<build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>native-maven-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
		<compilerProvider>generic</compilerProvider>
        <compilerExecutable>icl</compilerExecutable>
	
<compilerStartOptions>-I"C:\Programme\Intel\Compiler\C++\9.1\IA32\Includ
e"</compilerStartOptions>
		<linkerStartOptions>-shared -lxml2 -lz -lpthread
-ldl</linkerStartOptions>
	
<linkerMiddleOptions>-L"C:\Programme\Intel\Compiler\C++\9.1\IA32\Lib"</l
inkerMiddleOptions>
           <sources>
             <source>
              <directory>/src/main/native</directory>
              <includes>
                <include>*.cpp</include>
              </includes>
             </source>
          </sources>
       </configuration>
      </plugin>
    </plugins>
  </build>
</project>

-----Original Message-----
From: Dan Tran [mailto:dantran@gmail.com] 
Sent: Tuesday, May 08, 2007 6:48 AM
To: Maven Users List
Subject: Re: Maven native plugin


take tout

<your code>

             <source>

<directory>C:\Programme\Intel\Compiler\C++\9.1\IA32\Include</directory>
              <includes>
                <include>*.h</include>
              </includes>
             </source>
             <source>

             <source>

<directory>C:\Programme\Intel\Compiler\C++\9.1\IA32\Lib</directory>
              <includes>
                <include>*.lib</include>
              </includes>
              <includes>
                <include>*.dll</include>
              </includes>
             </source>
</yourcode>

-  Dont think we support compilation of .h file

-  Dont think the compliler can compile .dll files

-  Dont think we support *.lib, you must explicitely link it via
LinkerStartOption using your linker specific arguments


Best to take to present INCLUDE and LIB system environment variables
prior to running mvn

-D






On 5/7/07, jBeuchat <jo...@iss-ag.ch> wrote:
>
>
> Thank you for your answer.
> I have done what you told me to do, but still have an error. There is 
> something wrong, but i don't know what.
>
>
> The dependencies?
> The sources?
>
> or that?
> <compilerProvider>generic</compilerProvider>
> <compilerExecutable>icl</compilerExecutable>
>
> ??
>
> THank you for your help!
>
> Here my "pom.xml" :
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>com.mycompany.app</groupId>
> <artifactId>my-app</artifactId>
> <packaging>so</packaging>
> <version>1.0-SNAPSHOT</version>
> <name>my-app</name>
> <url>http://maven.apache.org</url>
> <dependencies>
>    <dependency>
>      <groupId>junit</groupId>
>      <artifactId>junit</artifactId>
>      <version>3.8.1</version>
>      <scope>test</scope>
>    </dependency>
> </dependencies>
> <build>
>     <plugins>
>       <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>native-maven-plugin</artifactId>
>         <extensions>true</extensions>
>         <configuration>
>            <linkerStartOptions>
>               <linkerStartOption>-shared -lxml2 -lz -lpthread 
> -ldl</linkerStartOption>
>            </linkerStartOptions>
>            <sources>
>              <source>
>               <directory>/src/main/native</directory>
>               <includes>
>                 <include>*.cpp</include>
>               </includes>
>              </source>
>              <source>
>
>
<directory>C:\Programme\Intel\Compiler\C++\9.1\IA32\Include</directory>
>               <includes>
>                 <include>*.h</include>
>               </includes>
>              </source>
>              <source>
>
> <directory>C:\Programme\Intel\Compiler\C++\9.1\IA32\Lib</directory>
>               <includes>
>                 <include>*.lib</include>
>               </includes>
>               <includes>
>                 <include>*.dll</include>
>               </includes>
>              </source>
>           </sources>
>           <compilerProvider>generic</compilerProvider>
>           <compilerExecutable>icl</compilerExecutable>
>        </configuration>
>       </plugin>
>     </plugins>
>   </build>
> </project>
>
>
> Sean Hennessy wrote:
> >
> >
> > It appears that an include path directive is missing on the command
> line.
> > Hunt through the Intel compiler and the native documentation 
> > http://mojo.codehaus.org/maven-native/native-maven-plugin/usage.html

> > and find the section in the pom that allows one to specify include
> files/paths
> > for the compiler.
> > It might be that you will experiment with the 
> > <compilerStartOptions>..
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/Maven-native-plugin-tf3639190s177.html#a10370684
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven native plugin

Posted by Dan Tran <da...@gmail.com>.
take tout

<your code>

             <source>

<directory>C:\Programme\Intel\Compiler\C++\9.1\IA32\Include</directory>
              <includes>
                <include>*.h</include>
              </includes>
             </source>
             <source>

             <source>

<directory>C:\Programme\Intel\Compiler\C++\9.1\IA32\Lib</directory>
              <includes>
                <include>*.lib</include>
              </includes>
              <includes>
                <include>*.dll</include>
              </includes>
             </source>
</yourcode>

-  Dont think we support compilation of .h file

-  Dont think the compliler can compile .dll files

-  Dont think we support *.lib, you must explicitely link it via
LinkerStartOption using your linker specific arguments


Best to take to present INCLUDE and LIB system environment variables prior
to running mvn

-D






On 5/7/07, jBeuchat <jo...@iss-ag.ch> wrote:
>
>
> Thank you for your answer.
> I have done what you told me to do, but still have an error. There is
> something wrong, but i don't know what.
>
>
> The dependencies?
> The sources?
>
> or that?
> <compilerProvider>generic</compilerProvider>
> <compilerExecutable>icl</compilerExecutable>
>
> ??
>
> THank you for your help!
>
> Here my "pom.xml" :
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>com.mycompany.app</groupId>
> <artifactId>my-app</artifactId>
> <packaging>so</packaging>
> <version>1.0-SNAPSHOT</version>
> <name>my-app</name>
> <url>http://maven.apache.org</url>
> <dependencies>
>    <dependency>
>      <groupId>junit</groupId>
>      <artifactId>junit</artifactId>
>      <version>3.8.1</version>
>      <scope>test</scope>
>    </dependency>
> </dependencies>
> <build>
>     <plugins>
>       <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>native-maven-plugin</artifactId>
>         <extensions>true</extensions>
>         <configuration>
>            <linkerStartOptions>
>               <linkerStartOption>-shared -lxml2 -lz -lpthread
> -ldl</linkerStartOption>
>            </linkerStartOptions>
>            <sources>
>              <source>
>               <directory>/src/main/native</directory>
>               <includes>
>                 <include>*.cpp</include>
>               </includes>
>              </source>
>              <source>
>
> <directory>C:\Programme\Intel\Compiler\C++\9.1\IA32\Include</directory>
>               <includes>
>                 <include>*.h</include>
>               </includes>
>              </source>
>              <source>
>
> <directory>C:\Programme\Intel\Compiler\C++\9.1\IA32\Lib</directory>
>               <includes>
>                 <include>*.lib</include>
>               </includes>
>               <includes>
>                 <include>*.dll</include>
>               </includes>
>              </source>
>           </sources>
>           <compilerProvider>generic</compilerProvider>
>           <compilerExecutable>icl</compilerExecutable>
>        </configuration>
>       </plugin>
>     </plugins>
>   </build>
> </project>
>
>
> Sean Hennessy wrote:
> >
> >
> > It appears that an include path directive is missing on the command
> line.
> > Hunt through the Intel compiler and the native documentation
> > http://mojo.codehaus.org/maven-native/native-maven-plugin/usage.html and
> > find the section in the pom that allows one to specify include
> files/paths
> > for the compiler.
> > It might be that you will experiment with the <compilerStartOptions>..
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Maven-native-plugin-tf3639190s177.html#a10370684
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Maven native plugin

Posted by jBeuchat <jo...@iss-ag.ch>.
Thank you for your answer. 
I have done what you told me to do, but still have an error. There is
something wrong, but i don't know what. 


The dependencies?
The sources?

or that?
 <compilerProvider>generic</compilerProvider>
 <compilerExecutable>icl</compilerExecutable> 

??

THank you for your help!

Here my "pom.xml" : 

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mycompany.app</groupId>
  <artifactId>my-app</artifactId>
  <packaging>so</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>my-app</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>   
     <plugins>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>native-maven-plugin</artifactId>
         <extensions>true</extensions>
         <configuration>
            <linkerStartOptions>
               <linkerStartOption>-shared -lxml2 -lz -lpthread
-ldl</linkerStartOption> 
            </linkerStartOptions>
	    <sources>  
              <source>
               <directory>/src/main/native</directory>
               <includes>
                 <include>*.cpp</include>
               </includes>            
	      </source>
              <source>
              
<directory>C:\Programme\Intel\Compiler\C++\9.1\IA32\Include</directory>
               <includes>
                 <include>*.h</include>
               </includes>            
	      </source>
	      <source>
              
<directory>C:\Programme\Intel\Compiler\C++\9.1\IA32\Lib</directory>
               <includes>
                 <include>*.lib</include>
               </includes> 
	       <includes>
                 <include>*.dll</include>
               </includes>            
	      </source>
	   </sources>
	   <compilerProvider>generic</compilerProvider>
           <compilerExecutable>icl</compilerExecutable>	
	</configuration>
       </plugin>
     </plugins>
   </build>
</project>


Sean Hennessy wrote:
> 
> 
> It appears that an include path directive is missing on the command line.
> Hunt through the Intel compiler and the native documentation
> http://mojo.codehaus.org/maven-native/native-maven-plugin/usage.html and
> find the section in the pom that allows one to specify include files/paths
> for the compiler.
> It might be that you will experiment with the <compilerStartOptions>..
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-native-plugin-tf3639190s177.html#a10370684
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Maven native plugin

Posted by Sean Hennessy <sh...@astutenetworks.com>.
It appears that an include path directive is missing on the command line.
Hunt through the Intel compiler and the native documentation http://mojo.codehaus.org/maven-native/native-maven-plugin/usage.html and find the section in the pom that allows one to specify include files/paths for the compiler.
It might be that you will experiment with the <compilerStartOptions>..


-----Original Message-----
From: Beuchat José [mailto:Jose.Beuchat@sisltd.ch] 
Sent: Tuesday, April 24, 2007 7:53 AM
To: users@maven.apache.org
Subject: Maven native plugin


Hello, 

 

I want to use the maven "native plugin" to compile C++ project. The compilator is ok, but I've problems with the libraries. 

 

Here the error message: 

 

D:\MavenTests\my-app>mvn package

[INFO] Scanning for projects...

[INFO] ----------------------------------------------------------------------------

[INFO] Building my-app

[INFO]    task-segment: [package]

[INFO] ----------------------------------------------------------------------------

[INFO] [native:initialize]

[INFO] [native:compile]

[INFO] icl -ID:\MavenTests\my-app\src\main\native -o D:\MavenTests\my-app\target\test.

obj -c D:\MavenTests\my-app\src\main\native\test.cpp

Intel(R) C++ Compiler for 32-bit applications, Version 9.1    Build 20060706Z Package

ID: W_CC_C_9.1.028

Copyright (C) 1985-2006 Intel Corporation.  All rights reserved.

 

test.cpp

D:\MavenTests\my-app\src\main\native\test.cpp(1): catastrophic error: could not open s

ource file "iostream"

  #include <iostream>

                     ^

 

compilation aborted for D:\MavenTests\my-app\src\main\native\test.cpp (code 4)

[INFO] ------------------------------------------------------------------------

[ERROR] BUILD ERROR

[INFO] ------------------------------------------------------------------------

[INFO] Error executing command line. Exit code:4

 

[INFO] ------------------------------------------------------------------------

[INFO] For more information, run Maven with the -e switch

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 2 seconds

[INFO] Finished at: Tue Apr 24 16:51:47 CEST 2007

[INFO] Final Memory: 4M/9M

[INFO] ------------------------------------------------------------------------

 

 

 

 

 

 

 

Could you help me? Or give me an example of the pom.xml file with specified libraries?

 

Sincerely 

 

Beuchat José

Informatiker

ISS AG

Allmendstrasse 11

CH - 2563 Port / Schweiz

Jose.Beuchat@iss-ag.ch

 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org