Profiles — conan 1.59.0 documentation (2024)

This document is for a "1.X" Conan version. Click here to see the Conan 2.0 documentation

Profiles allows users to set a complete configuration set for settings, options, environment variables, and buildrequirements in a file. They have this structure:

[settings]setting=value[options]MyLib:shared=True[env]# [env] is deprecated! Use [buildenv] insteadenv_var=value[tool_requires]tool1/0.1@user/channeltool2/0.1@user/channel, tool3/0.1@user/channel*: tool4/0.1@user/channel

Profile can be created with new option in conan profile. And then edit it later.

$ conan profile new mynewprofile --detect

Profile files can be used with -pr/--profile option in many commands like conan install or conan create commands.

$ conan create . demo/testing -pr=myprofile

Profiles can be located in different folders. For example, the default <userhome>/.conan/profiles, and be referenced by absolute orrelative path:

$ conan install . --profile /abs/path/to/profile # abs path$ conan install . --profile ./relpath/to/profile # resolved to current dir$ conan install . --profile ../relpath/to/profile # resolved to relative dir$ conan install . --profile profile # resolved to user/.conan/profiles/profile

Listing existing profiles in the profiles folder can be done like this:

$ conan profile listdefaultmyprofile1myprofile2...

You can also show profile’s content:

$ conan profile show myprofile1Configuration for profile myprofile1:[settings]os=Windowsarch=x86_64compiler=Visual Studiocompiler.version=15build_type=Release[options][tool_requires][env]

Use $PROFILE_DIR in your profile and it will be replaced with the absolute path tothe directory where the profile file is (this path will contain only forward slashes).It is useful to declare relative folders:

[env]PATH=$PROFILE_DIR/dev_tools

Tip

You can manage your profiles and share them using conan config install.

Package settings and env vars

Profiles also support package settings and package environment variables definition, so you can override some settings orenvironment variables for some specific package:

.conan/profiles/zlib_with_clang

 [settings] zlib:compiler=clang zlib:compiler.version=3.5 zlib:compiler.libcxx=libstdc++11 compiler=gcc compiler.version=4.9 compiler.libcxx=libstdc++11 [env] zlib:CC=/usr/bin/clang zlib:CXX=/usr/bin/clang++

Your build tool will locate clang compiler only for the zlib package and gcc (default one) for the rest of your dependency tree.

They accept patterns too, like -s *@myuser/*, which means that packages that have the username “myuser” will use clang 3.5 as compiler, and gcc otherwise:

[settings]*@myuser/*:compiler=clang*@myuser/*:compiler.version=3.5*@myuser/*:compiler.libcxx=libstdc++11compiler=gcccompiler.version=4.9compiler.libcxx=libstdc++11

Also & can be specified as the package name. It will apply only to the consumer conanfile (.py or .txt).This is a special case because the consumer conanfile might not declare a name so it would be impossible to reference it.

[settings]&:compiler=gcc&:compiler.version=4.9&:compiler.libcxx=libstdc++11

Note

If you want to override existing system environment variables, you should use the key=value syntax. If you need to pre-pend to thesystem environment variables you should use the syntax key=[value] or key=[value1, value2, ...]. A typical example is thePATH environment variable, when you want to add paths to the existing system PATH, not override it, you would use:

[env]PATH=[/some/path/to/my/tool]

[buildenv]

Available since: 1.35.0

Important

The use of this [buildenv] section requires using the VirtualBuildEnv generator in your recipe,or putting the configuration tools.env.virtualenv:auto_use=True in your profile.

This profile section is aimed to be the replacement of the legacy [env] one. It’s more powerful, and it is able toapply some additional operators to each variable declared when you’re composing profiles or even local variables:

  • += == append: appends values at the end of the existing value.
  • =+ == prepend: puts values at the beginning of the existing value.
  • =! == unset: gets rid of any variable value.

Another essential point to mention is the possibility of defining variables as PATH ones by simply putting (path) asthe prefix of the variable. It is useful to automatically get the append/prepend of the PATH in different systems(Windows uses ; as separation, and UNIX :).

.conan/profiles/myprofile

[buildenv]# Define a variable "MyVar1"MyVar1=My Value; other# Append another value to "MyVar1"MyVar1+=MyValue12# Define a PATH variable "MyPath1"MyPath1=(path)/some/path11# Prepend another PATH to "MyPath1"MyPath1=+(path)/other path/path12# Unset the variable "PATH" for all the packages matching the pattern "mypkg*"mypkg*:PATH=!

Then, the result of applying this profile is:

  • MyVar1: My Value; other MyValue12
  • MyPath1:
    • Unix: /other path/path12:/some/path11
    • Windows: /other path/path12;/some/path11
  • mypkg*:PATH: None

See more information about the new environments in the conan.tools.env reference.

[runenv]

Available since: 1.53.0

Important

The use of this [runenv] section requires using the VirtualRunEnv generator in your recipe.

This profile section allows defining environment variables that will be injected to theenvironment every time the ConanFile run(cmd, env="conanrun") method is invoked. You can use the sameoperators explained for the [buildenv] section and also define PATHvariables.

Tools configurations

Important

This feature is still under development, while it is recommended and usable and we will try not to break them in future releases,some breaking changes might still happen if necessary to prepare for the Conan 2.0 release.

Tools configurations can also be used in profile files and global.conf one. Profile values will have priority over globally defined ones in global.conf, and can be defined as:

[settings]...[conf]tools.microsoft.msbuild:verbosity=Diagnostictools.microsoft.msbuild:max_cpu_count=2tools.microsoft.msbuild:vs_version = 16tools.build:jobs=10

See also

You can see more information about configurations in global.conf section.

Profile composition

You can specify multiple profiles in the command line. The applied configuration will be the compositionof all the profiles applied in the order they are specified.

If, for example, you want to apply a tool require, like a cmake installer to your dependency tree,it won’t be very practical adding the cmake installer reference, e.g cmake/3.16.3 to all your profiles where you couldneed to inject cmake as a tool require.

You can specify both profiles instead:

.conan/profiles/cmake_316

 [tool_requires] cmake/3.16.3
$ conan install . --profile clang --profile cmake_316

Profile includes

You can include other profiles using the include() statement. The path can be relative to the current profile, absolute, or a profilename from the default profile location in the local cache.

The include() statement has to be at the top of the profile file:

gcc_49

 [settings] compiler=gcc compiler.version=4.9 compiler.libcxx=libstdc++11

myprofile

 include(gcc_49) [settings] zlib:compiler=clang zlib:compiler.version=3.5 zlib:compiler.libcxx=libstdc++11 [env] zlib:CC=/usr/bin/clang zlib:CXX=/usr/bin/clang++

Variable declaration

In a profile you can declare variables that will be replaced automatically by Conan before the profile is applied. The variables have to bedeclared at the top of the file, after the include() statements.

myprofile

include(gcc_49)CLANG=/usr/bin/clang[settings]zlib:compiler=clangzlib:compiler.version=3.5zlib:compiler.libcxx=libstdc++11[env]zlib:CC=$CLANG/clangzlib:CXX=$CLANG/clang++

The variables will be inherited too, so you can declare variables in a profile and then include the profile in a different one, all thevariables will be available:

gcc_49

GCC_PATH=/my/custom/toolchain/path/[settings]compiler=gcccompiler.version=4.9compiler.libcxx=libstdc++11

myprofile

include(gcc_49)[settings]zlib:compiler=clangzlib:compiler.version=3.5zlib:compiler.libcxx=libstdc++11[env]zlib:CC=$GCC_PATH/gcczlib:CXX=$GCC_PATH/g++

Build profiles and host profiles

All the commands that take a profile as an argument, from Conan v1.24 are starting to accept two profiles withcommand line arguments -pr:h/--profile:host and -pr:b/--profile:build. If both profiles areprovided, Conan will build a graph with some packages associated with the host platform and some buildrequirements associated to the build platform. There are two scenarios where this feature isextremely useful:

  • Creating conan packages to install dev tools
  • Cross building

The default build profile in Conan 1.X is not defined by default, and needs to be specified in command line.However, it is also possible to define a default one in global.conf configuration file with:

global.conf

 core:default_build_profile=default core:default_profile=linux_armv8

The default host profile can be defaulted as well using this configuration method.

Profile templates

Important

This feature is still under development, while it is recommended and usable and we will try not to break them in future releases,some breaking changes might still happen if necessary to prepare for the Conan 2.0 release.

From Conan 1.38 it is possible to use jinja2 template engine for profiles. This feature isenabled by naming the profile file with the .jinja extension. When Conan loads a profile withthis extension, immediately parses and renders the template, which must result in a standardtext profile.

Some of the capabilities of the profile templates are:

  • Using the platform information, like obtaining the current OS is possible because thePython platform module is added to the render context.:

    [settings]os = {{ {"Darwin": "Macos"}.get(platform.system(), platform.system()) }}
  • Reading environment variables can be done because the Python os module is addedto the render context.:

    [settings]build_type = {{ os.getenv("MY_BUILD_TYPE") }}
  • Defining your own variables and using them in the profile:

    {% set a = "FreeBSD" %}[settings]os = {{ a }}
  • Joining and defining paths, including referencing the current profile directory. Forexample, defining a toolchain which file is located besides the profile can be done.Besides the os Python module, the variable profile_dir pointing to the current profilefolder is added to the context.

    [conf]tools.cmake.cmaketoolchain:toolchain_file = {{ os.path.join(profile_dir, "toolchain.cmake") }}
  • Including or importing other files from profiles folder:

    profile_vars.jinja

    {% set a = "Debug" %}

    profile1.jinja

    {% import "profile_vars.jinja" as vars %}[settings]build_type = {{ vars.a }}
  • Any other feature supported by jinja2 is possible: for loops, if-else, etc. Thiswould be useful to define custom per-package settings or options for multiple packagesin a large dependency graph.

Examples

If you are working with Linux and you usually work with gcc compiler, but you have installed clang compiler and want to install somepackage for clang compiler, you could do:

  • Create a .conan/profiles/clang file:
[settings]compiler=clangcompiler.version=3.5compiler.libcxx=libstdc++11[env]CC=/usr/bin/clangCXX=/usr/bin/clang++
  • Execute an install command passing the --profile or -pr parameter:
$ conan install . --profile clang

Without profiles you would have needed to set CC and CXX variables in the environment to point to your clang compiler and use -sparameters to specify the settings:

$ export CC=/usr/bin/clang$ export CXX=/usr/bin/clang++$ conan install -s compiler=clang -s compiler.version=3.5 -s compiler.libcxx=libstdc++11

A profile can also be used in conan create and conan info:

$ conan create . demo/testing --profile clang

See also

  • Check the section Tool requirements to read more about its usage in a profile.
  • Check conan profile and profiles/default for full reference.
  • Related section: Cross building.
Profiles — conan 1.59.0 documentation (2024)

FAQs

Where are conan profiles located? ›

Lists profiles in the '. conan/profiles' folder, or shows profile details. The 'list' subcommand will always use the default user 'conan/profiles' folder.

How do I add a package to conan? ›

Install a Conan package
  1. In the project where you want to install the package as a dependency, open conanfile. txt . ...
  2. Add the Conan recipe to the [requires] section of the file: ...
  3. At the root of your project, create a build directory and change to that directory: ...
  4. Install the dependencies listed in conanfile.txt :

What does conan install do? ›

Installs the requirements specified in a recipe (conanfile.py or conanfile. txt). It can also be used to install a concrete package specifying a reference.

Where does Conan store credentials? ›

After a successful login the auth token is stored in the local database (see CONAN_LOGIN_ENCRYPTION_KEY to add a basic level of security). The password is not stored in the client computer at any moment. Conan uses JWT, so it gets a token (expirable by the server) checking the password against the remote credentials.

What is a Conanfile? ›

The files are: conanfile.py is a Conan "recipe". It declares dependencies, how to build a package from sources. The same recipe can be used to manage different configurations, like different platforms, compilers, build types, etc.

How do I add a local package? ›

Select your project in the Project navigator, then select your app target and navigate to its General pane. Click the + button in the “Frameworks, Libraries, and Embedded Content” section, select the local package's library product, and add it as a dependency.

How do I install an installed package? ›

Steps to Install a Package in R
  1. Step 1: Launch R. To start, you'll need to launch R. ...
  2. Step 2: Type the command to install the package. ...
  3. Step 3: Select a Mirror for the installation. ...
  4. Step 4: Start using the package installed.

Where does Conan install libraries? ›

It is common that *. dll are copied to /bin. The rest of the libraries should be found in the /lib folder, however, this is just a convention, and different layouts are possible. Now look at the build/bin folder and verify that the required shared libraries are there.

How do I update Conan package manager? ›

Please update Conan by running pip install --upgrade conan or by downloading the Windows installer. The Conan package manager helps to install all required libraries in a convenient way on every platform.

Is Conan IO free? ›

Conan is open source and completely free.

It has native integration with JFrog Artifactory, including the free Artifactory Community Edition for Conan, enabling developers to host their own private packages on their own server.

Where can I store my credentials? ›

There is no better way to keep your passwords safe than to use a password manager, like Bitwarden. A good password manager should do more than store passwords, such as generate strong passwords and monitor data breaches for compromised passwords.

Where are application credentials stored? ›

An application must receive credentials from somewhere to use services it depends on. These credentials are usually stored in configuration files. Manually entering each server to create that file is out of the question, since servers come and go without human intervention.

How do I access Conan admin commands? ›

Join your Conan Exiles server, then press ESC to open the menu. Once there, click the Admin Panel option and it'll instantly appear in-game. Note: Otherwise, press Shift + Insert on your keyboard to open the panel. You can now checkmark settings, enter values, and spawn items in your inventory.

What is conan in Devops? ›

Conan, a distributed, open source package and dependency manager, promises to bring C and C++ into devops. The multiplatform package manager builds and shares native binaries.

What is conan in Python? ›

Conan: A Python package manager. Conan is a C and C++ package manager, and to deal with the vast variability of C and C++ build systems, compilers, configurations, etc., it was designed to be extremely flexible, to allow users the freedom to configure builds in virtually any manner required.

Does conan build from source? ›

Calls your local conanfile.py 'build()' method. The recipe will be built in the local directory specified by –build-folder, reading the sources from –source-folder. If you are using a build helper, like CMake(), the –package-folder will be configured as the destination folder for the install step.

How do I create my own package? ›

How to create packages
  1. First, we create a directory as a sub-directory of bin whose name is the same as the package's name. ...
  2. Now, move into the new directory. ...
  3. After creating the class, save it with the class-name and compile it. ...
  4. After creating the package with a set of classes, move into bin directory.

How do I create a new package? ›

How to Create a package?
  1. Choose the name of the package.
  2. Include the package command as the first line of code in your Java Source File.
  3. The Source file contains the classes, interfaces, etc you want to include in the package.
  4. Compile to create the Java packages.
Jan 7, 2023

How do I import an entire package? ›

Importing an Entire Package

To import all the types contained in a particular package, use the import statement with the asterisk (*) wildcard character. Now you can refer to any class or interface in the graphics package by its simple name. Circle myCircle = new Circle(); Rectangle myRectangle = new Rectangle();

What is the command to install a package? ›

The Install-Package cmdlet installs a software package and its dependencies. Install-Package uses parameters to specify the packages Name and Source. The Credential parameter uses a domain user account with permissions to install packages. The command prompts you for the user account password.

Where is package installer in settings? ›

If you're curious, you can find Package Installer by going to the Apps menu of your device settings and enabling Show system apps.

Can you pip install a local package? ›

Install the downloaded package into a local directory : python get-pip.py --user This will install pip to your local directory (. local/bin) . Now you may navigate to this directory (cd . local/bin) and then use pip or better set your $PATH variable this directory to use pip anywhere : PATH=$PATH:~/.

How do you get documentation of an installed and loaded R package? ›

Once installed, you can get a list of all the functions in the package. If the package is on CRAN, you will find documentation in PDF format of all functions inside a page like https://cran.r-project.org/web/packages/package_name . Recall you can access this documentation in HTML format with the help function.

How do I manually install apt package? ›

You can do this in two separate steps:
  1. Install the package with dpkg . sudo dpkg -i packagename.deb.
  2. That created missing dependencies. apt-get can fix missing dependencies automatically. sudo apt-get -f install. That should also automatically finish configuring the original package.
Apr 21, 2016

How can I get a list of installed packages? ›

The procedure to list what packages are installed on Ubuntu:
  1. Open the terminal application or log in to the remote server using ssh (e.g. ssh user@sever-name )
  2. Run command apt list --installed to list all installed packages on Ubuntu.
Feb 13, 2023

How do I know which library is installed? ›

Check the version of Python package/library
  1. Get package version in Python script: __version__ attribute.
  2. Check package version with pip command. List installed packages: pip list. List installed packages: pip freeze. Check details of installed packages: pip show.
  3. Check package version with conda command: conda list.
Sep 20, 2019

How do I install a specific version of a library? ›

To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion. For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1.

How do I install a specific version of Conan? ›

Install from source

First, you need to install Python and pip. Clone (or download and unzip) the git repository and install it with: # clone folder name matters, to avoid imports issues $ git clone https://github.com/conan-io/conan.git conan_src $ cd conan_src $ python -m pip install -e . Test your conan installation.

Does yum update update all packages? ›

If run without any packages, update will update every currently installed package. If one or more packages or package globs are specified, Yum will only update the listed packages. While updating packages, yum will ensure that all dependencies are satisfied.

How do I update my package to the latest version? ›

How to upgrade a dependency/package in your current project using Go commands
  1. List all dependencies. First, list all the current dependencies using the following command: go list -m all. ...
  2. Download latest version. Next, use the following Go command to download the latest version of the package: go get <package-name> ...
  3. Test.
Aug 11, 2020

How do I update all packages? ›

Updating local packages
  1. Navigate to the root directory of your project and ensure it contains a package.json file: cd /path/to/project.
  2. In your project root directory, run the update command: npm update.
  3. To test the update, run the outdated command. There should not be any output.

What does Conan do C++? ›

Conan is a package manager that lets C and C++ developers capture artifacts created during builds of applications and libraries, storing them as a Conan Package. Developers can access Conan Packages stored in Conan Center, a central repository with hundreds of open source applications and libraries.

How many hours is Conan Exiles? ›

Powered by IGN Wiki Guides
Single-PlayerPolledAverage
Main Story1335h 48m
Main + Extras15127h 55m
Completionist10147h 25m
All PlayStyles38101h 32m

Should I play Conan Exiles solo? ›

It's fine solo. There are a few issues though. When ever you exit a game day/night cycle and mob/resource nodes reset. So don't exit the game near enemies.

Where are Conan packages stored? ›

By convention, this file will be located in the user home folder ~/. conan/. This folder will also typically store the package cache in ~/. conan/data.

Where is Conan Exiles mod folder? ›

Installing Mods

Once they are downloaded you can find them in the "Mods" menu from the Main Menu in-game. You can also use mods that you get outside of the Steam Workshop - put the mod . pak file in " <SteamLibrary>\steamapps\common\Conan Exiles\ConanSandbox\Mods " and it will be available in the in-game mods menu.

Where is my Arma profile? ›

If you're not using the -name parameter, the default name "player" will be used and you'll find the Arma 3 profile in player/player. armaprofile .

Where does Conan get installed? ›

Conan can be installed in many Operating Systems. It has been extensively used and tested in Windows, Linux (different distros), OSX, and is also actively used in FreeBSD and Solaris SunOS. There are also several additional operating systems on which it has been reported to work.

How do I pull a conan package? ›

conan get
  1. Print the conanfile.py from a remote package: $ conan get zlib/1.2.8@ -r conancenter.
  2. List the files for a local package recipe: $ conan get zlib/1.2.11@ . ...
  3. Print a file from a recipe folder: ...
  4. Print the conaninfo.txt file for a binary package: ...
  5. List the files from a binary package in a remote:

What is conan package manager? ›

Conan is a decentralized package manager with a client-server architecture. This means that clients can fetch packages from, as well as upload packages to, different servers (“remotes”), similar to the “git” push-pull model to/from git remotes. At a high level, the servers are just storing packages.

How do I access conan Admin console? ›

To use the Admin Panel and gain access to some of the most powerful console commands, players will need to open up the menu (with the Escape key) and then go to Settings before then selecting Server Settings. Select the "Make Me Admin" option, which should be confirmed with a message saying "Admin Rights Granted".

Where do I extract mod files? ›

b) On the MOD menu, click the [Download MOD] button and the game will show the following interface. c) Click the [Open my MOD folder now] button and it will automatically locate the MOD folder using File Explorer. e) Copy the MOD folder path from File Explorer, then paste it onto the Destination Path field.

How do I manually install Conan Exiles mods? ›

Activate mods
  1. Run the game;
  2. On the main menu navigate to the “ Mods ” menu. ...
  3. Move the mod(s) you wish to activate to the “Selected Mods” column;
  4. Press back and restart the game as requested;
  5. On the next run of the game, mods should be installed and ready to use on Single-Player/Co-op.
Jun 3, 2021

Where do I put mod files? ›

The mods folder will be located on the drive you installed Minecraft on, in a folder you can find through clicking “users,” your Windows name, “App Data,” “Roaming,” and then “. minecraft.” If there's no folder named “mods” in there, you can make one and just drop your downloaded mods in.

How do you copy Arma profile? ›

Yes.
  1. First start the game and create your new profile with default settings. ...
  2. Go to C:\Users\YourUserName\Documents\Arma 3 Alpha. ...
  3. Then go to C:\Users\YourUserName\Documents\Arma 3 Alpha - Other Profiles\NewNick. ...
  4. Cut the NewNick files and paste them to desktop.
Mar 9, 2013

How do I open the Arma task list? ›

Alternatively, you can access your tasks on the map. Open the map [M] and select Tasks.

Where is my conan cache? ›

By convention, this file will be located in the user home folder ~/. conan/. This folder will also typically store the package cache in ~/. conan/data.

How do I update conan package manager? ›

Please update Conan by running pip install --upgrade conan or by downloading the Windows installer. The Conan package manager helps to install all required libraries in a convenient way on every platform.

What is the latest conan version? ›

Changelog
  • 1.59.0 (16-Feb-2023) Feature: Update requirements.txt to use distro package version <=1.8.0. # ...
  • 1.58.0 (30-Jan-2023) Feature: Update gcc versions supported in settings. # ...
  • 1.57.0 (12-Jan-2023) ...
  • 1.56.0 (21-Dec-2022) ...
  • 1.55.0 (30-Nov-2022) ...
  • 1.54.0 (07-Nov-2022) ...
  • 1.53.0 (04-Oct-2022) ...
  • 1.52.0 (31-Aug-2022)

Top Articles
Latest Posts
Article information

Author: Mr. See Jast

Last Updated:

Views: 5779

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Mr. See Jast

Birthday: 1999-07-30

Address: 8409 Megan Mountain, New Mathew, MT 44997-8193

Phone: +5023589614038

Job: Chief Executive

Hobby: Leather crafting, Flag Football, Candle making, Flying, Poi, Gunsmithing, Swimming

Introduction: My name is Mr. See Jast, I am a open, jolly, gorgeous, courageous, inexpensive, friendly, homely person who loves writing and wants to share my knowledge and understanding with you.