Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Combine object decks into one file

Brian_A_
Novice
970 Views
I want to combine my object decks into one file. Is this possible and if so how do you do it.
I have object decks in 5 folders.
0 Kudos
7 Replies
Steven_L_Intel1
Employee
970 Views
It would be best to combine them into a library. From a build environment command prompt you'd do:

lib /out:newlib.lib object1.obj object2.obj ...

If you need to do this in multiple commands, make the second and subsequent commands:

lib newlib.lib object3.obj object4.obj ...

You can use wildcards if you want, such as folder\*.obj

If you really want a combined .obj, then use the copy command:

copy object1.obj+object2.obj+object3.obj newobject.obj

Again you can use wildcards for the source.
0 Kudos
bmchenry
New Contributor II
970 Views
First put the projects all into one solution (you may already have done this)
then use $(SolutionDir)$(Configuration) as the output directory
and/or
in the Linker section for output File use $(OutDir)$(TargetName)$(TargetExt)
Click Edit on the 'Output File' fild to bring up the 'macros' listing so you can see the meaning of each of those terms for your particular project, solution and installation.
0 Kudos
Brian_A_
Novice
970 Views
ok actually my obj files do get put into .lib files. My problem is if I delete the .obj files and recompile, it looks to see if the .obj files are there, and if they are not, it makes new ones. How can I tell it to look into the lib files to check for the .obj files?
0 Kudos
Steven_L_Intel1
Employee
970 Views
What is "it" you need to tell? Typically you would not delete the .obj files, as you then mess up the dependency checking.
0 Kudos
Brian_A_
Novice
970 Views
Well what we do is some of our customers get a compile library. It includes our source but only a portion of it. The actuall source files that we leave out, the customer gets the obj file. Is there a way to put just the obj files that do not have the source with them into a dll?
0 Kudos
Steven_L_Intel1
Employee
970 Views
Now you're asking about a DLL? One can write a script that cycles through the .obj files in a folder and take action on only those where there is no corresponding .f90 (or whatever) file. This action would probably be to insert into a .lib. You could then link a DLL from that library.
0 Kudos
jimdempseyatthecove
Honored Contributor III
970 Views
It would seem like you need three projects:

1) One that builds your library making the dependency checks of the source and .obj files of the library
2) One that that is not dependent on the project that builds the library but rather is only dependent on the library itself. This is the one that the customer is directed to use to build their applications.
3) One that your developer uses to build test applications and is dependent on the library and project that builds the library.

Your developer uses 1 and/or 3. Your customer uses 2).

In the projects for the customer, you can either:

a) Add the .obj files to the project that builds the customer applicaiton.
b) Add a project that builds a library that is dependent on the .obj files (and few source files distributed with your app).

Jim Dempsey
0 Kudos
Reply